#itemas-firebase

1 messages · Page 1 of 1 (latest)

elfin hatch
#

@glass berry no they aren't on Discord

glass berry
#

is there any way I can get help with that?

elfin hatch
#

I don't know anything about it, but I can try to help, depends a lot on the question

glass berry
#

I'm just looking at the source code:

  // Update their custom claims
  if (role) {
    try {
      // Get existing claims for the user
      const { customClaims } = await admin.auth().getUser(uid);
      // Set new role in custom claims as long as the subs status allows
      if (['trialing', 'active'].includes(subscription.status)) {
        logs.userCustomClaimSet(uid, 'stripeRole', role);
        await admin
          .auth()
          .setCustomUserClaims(uid, { ...customClaims, stripeRole: role });
      } else {
        logs.userCustomClaimSet(uid, 'stripeRole', 'null');
        await admin
          .auth()
          .setCustomUserClaims(uid, { ...customClaims, stripeRole: null });
      }
    } catch (error) {
      // User has been deleted, simply return.
      return;
    }
  }

Current behaviour is to have stripeRole boolean value when customer is subscribed to the plan

#

The problem is that I want to have something like patreon.com

#

and I want to have hundreds of different memberships, so instead I need something like an array that lists currently active plans:

activePlans:['planID1','planID2',etc...]
elfin hatch
#

yeah unfortunately I'm not sure that extension works for your use-case. You'll have to adapt or build your own version in that case

glass berry