Closed valeriangalliat closed 8 months ago
@valeriangalliat is attempting to deploy a commit to the Gladly Team on Vercel.
A member of the Team first needs to authorize it.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
nfa-example | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Nov 5, 2023 7:03pm |
All modified and coverable lines are covered by tests :white_check_mark:
Files | Coverage Δ | |
---|---|---|
src/firebaseAdmin.ts | 91.96% <100.00%> (+0.07%) |
:arrow_up: |
:loudspeaker: Thoughts on this report? Let us know!.
If the existing token is expired, and we refresh it successfully, we still need to call
veirfyIdToken
in order to get thefirebaseUser
, which is required bycreateUser
below.Currently, if
verifyIdToken
with the newly refreshed token fails, the error handler is called, but the code passes through, callingcreateUser
with atoken
butfirebaseUserAdminSDK: undefined
, which causes the following error:In order to prevent this, we need to set
newTokenFailure = true
in caseverifyIdToken
fails with the newly refreshed token.FWIW this never happened to me in production, but happens quite often when developing with the Firebase emulators.