- I successfully auth with phone-number. (I can check
firebase.auth.currentUser
that I'm logged in.) - Then I'm calling my firebase admin route which have
admin.auth().updateUser(uid, somevalues)
to set user displayName and email. - After this step finished and my user data changed displayName and email.(It is checked in firebase console)
In my auth I run
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.