Custom claims does not seem to be passed #316
Unanswered
beingadrian
asked this question in
Q&A
Replies: 1 comment
-
Thanks! Opened an issue here: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
Recently I've run into an issue with tokens with custom claims. The claims do not seem to be passed by the plugin when recreating the tokens on the server side.
Context
signInWithCustomToken
and get an ID token back (this ID token has the claims)withAuthUserTokenSSR
I callAuthUser.getIdToken
and I get an ID token back (this ID token does not have claims)Investigation
After a little dive into the source code, I find the following line:
next-firebase-auth/src/firebaseAdmin.js
Line 96 in f429935
Here it seems that the new tokens are only created with the user ID and the claims are not passed from the original ID token.
Claims could be passed by adding the second parameter:
https://firebase.google.com/docs/auth/admin/create-custom-tokens#create_custom_tokens_using_the_firebase_admin_sdk
--
I'm not sure if I've missed something here, but please let me know if there's a way around this.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions