Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firebase auth custom claims cleanup #71

Open
appsgenie opened this issue Mar 11, 2024 · 5 comments
Open

Firebase auth custom claims cleanup #71

appsgenie opened this issue Mar 11, 2024 · 5 comments

Comments

@appsgenie
Copy link

One a subscription expires, should the extension remove the "revenueCatEntitlements" from the firebase auth user's custom claims?

@jefago
Copy link
Contributor

jefago commented Mar 11, 2024

Yes, it should.

@appsgenie
Copy link
Author

hi @jefago thanks for the reply.
I have cases when the claim is still part of the firebase auth claim.. and Idea where to start debugging or if this is a know issue?

@jefago
Copy link
Contributor

jefago commented Mar 25, 2024

Do you have a customer / events collection set up as well? If so, that's the first place I would look – check if in the customers collection, the entitlement for that customer is still set, and in the events collection, if an EXPIRATION event is present for that customer.

@appsgenie
Copy link
Author

yes I do have both of those collections (as part of the RC firebase extension). and yes, the main reason I reported this is that I get an EXPIRATION event and the claims are still there. I am not sure how to look at the customers collection since that one always lists the entitlements even for expired customers. I guess the expires_date inside each entitlement would tell me if it's expired or not. but with grace periods etc it gets confusing. so to me, I rely on the events collection. once I get EXPIRATION or other flows that represent expiration then I remove user's entitlements on back-end. But the client having these still in the token is confusing..

@appsgenie
Copy link
Author

Also, what happens if the user is deleted from firebase auth? It seems that the extension currently throws an exception and I am not sure what the consequences of this are..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants