firebase.auth.currentUser
that I'm logged in.)admin.auth().updateUser(uid, somevalues)
to set user displayName and email.firebase.auth().currentUser.reload()
to get updated user data and suddenly there is error auth/user-token-expired
I have checked only after I use admin.auth().updateUser(....) my token is lost. If I do not run this command then I can do firebase.auth().currentUser.reload() without problem.UPDATE: Only if I set email when calling admin.auth().updateUser(....) my token inside app becomes invalid. If I change only displayName token remains valid.
I'm not sure what the exact question is here, but reload()
will use a refresh token, however, refresh tokens expire when "A major account change is detected for the user. This includes events like password or email address updates."
See: https://firebase.google.com/docs/auth/admin/manage-sessions
So when your refresh token expires (due to the 'major account change'), you need to re-authorize..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With