Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle failure to verify refreshed token (#679)
If the existing token is expired, and we refresh it successfully, we still need to call `veirfyIdToken` in order to get the `firebaseUser`, which is required by `createUser` below. Currently, if `verifyIdToken` with the newly refreshed token fails, the error handler is called, but the code passes through, calling `createUser` with a `token` but `firebaseUserAdminSDK: undefined`, which causes the following error: ``` Error: The "token" value can only be set if the "firebaseUserAdminSDK" property is defined. ``` In order to prevent this, we need to set `newTokenFailure = true` in case `verifyIdToken` fails with the newly refreshed token. FWIW this never happened to me in production, but happens quite often when developing with the Firebase emulators. Co-authored-by: Kevin Jennison <kevin.jennison1@gmail.com>
- Loading branch information