stripeRole not syncing to user claims

Viewed 108

I built a website (React + Firebase), and am now looking to add a paid subscription via Stripe.

I got this mostly working using the standard add-on (firestore-stripe-payments). Now, my checkout process works, and data from Stripe syncs to my firestore. I can see subscriptions appearing for my users in firestore. After adding stripeRole as metadata for my product in the Stripe dashboard, I can also see the field role in these subscriptions.

However, I can't figure out how to see the subscription role for the user in the frontend. Following some tutorials, it seems that user.getIdTokenResult() should get me a decodedToken.claims.stripeRole. I can get the decodedToken.claims but it just does not include stripeRole.

Where should I investigate further? / What should I do differently?

1 Answers

Happened to me also, but when I add the metadata firebaseRole to product not pricing in stripe, stripeRole appears in claims.

Related