firebase-tools-ui icon indicating copy to clipboard operation
firebase-tools-ui copied to clipboard

Editing user via Emulator UI seems to invalidate the user token.

Open rickwillcox opened this issue 2 years ago • 1 comments

Edit: Just noticed that changing any property on this form results in invalidating the user-token image

[REQUIRED] Environment info

firebase tools --version 11.8.0

Linux mint

[REQUIRED] Test case

  async function checkForUserVerification() {
    await reload(auth.currentUser);
    console.log('user: ', auth.currentUser);
    if (!auth.currentUser?.emailVerified) {
      setTimeout(checkForUserVerification, 1500);
    } else {
      console.log('user verified');
    }
  }
  useEffect(() => {
    checkForUserVerification();
  }, []);

[REQUIRED] Steps to reproduce

When using firebase emulator if I manually set the email to verified using the gui provided I get this error

index-69ab4e3a.js:474 Uncaught (in promise) FirebaseError: Firebase: Error (auth/user-token-expired).
    at createErrorInternal (index-69ab4e3a.js:474:1)
    at _fail (index-69ab4e3a.js:445:1)
    at _performFetchWithErrorHandling (index-69ab4e3a.js:976:1)
    at async _logoutIfInvalidated (index-69ab4e3a.js:1213:1)
    at async _reloadWithoutSaving (index-69ab4e3a.js:1371:1)
    at async reload (index-69ab4e3a.js:1410:1)

However when I use the real firebase server the code works as expected.

[REQUIRED] Expected behavior

when I set email to verified in firebase emulator gui the user verified should log.

[REQUIRED] Actual behavior

when I do above I get that error above. My code works perfectly as far as I can tell using a real firebase server instead of emulator.

rickwillcox avatar Sep 23 '22 07:09 rickwillcox