Skip to content

Firebase Auth errorFirebase Auth: auth/user-token-expired

auth/user-token-expired is the Firebase Auth error when the user’s refresh token is no longer valid. That happens when the user changes password or email on another device, or an admin revokes the tokens. A deleted or disabled user usually gets auth/user-not-found or auth/user-disabled instead.

Short answer

Catch the error wherever the app gets an ID token or calls Firebase, sign the user out cleanly, and send them to the sign-in screen with a short message. Don’t retry the same session: it can’t be refreshed.

Rather not fix it yourself? App Fix Ticket starts with a fixed-price diagnosis, then a fixed price for the fix before any fix work.

Why the session ended, and the fix

  1. 01

    The password or email changed elsewhere

    “This includes events like password or email address updates.” Firebase, Manage user sessions

    A password reset on the web ends sessions on the phone. Treat the error as a normal sign-out and ask the user to sign in again.

    try {
      const token = await auth.currentUser?.getIdToken();
    } catch (error) {
      if (error.code === 'auth/user-token-expired') {
        await signOut(auth); // the web SDK signs out too; native SDKs may not
        router.push('/sign-in?reason=session-ended');
      }
    }
  2. 02

    The user was deleted or disabled (usually a different code)

    “Refresh tokens expire only when one of the following occurs:” Firebase, Manage user sessions

    Deleting or disabling the account ends every session too, but expect auth/user-not-found or auth/user-disabled there. Handle all three the same way. A disabled user can be re-enabled; a deleted user has to sign up again.

  3. 03

    An admin revoked the tokens

    “The Firebase Admin SDK provides the ability to revoke refresh tokens for a specified user.” Firebase, Manage user sessions

    Server code that calls revokeRefreshTokens, for example after a security event, signs the user out everywhere. That is expected; show the sign-in screen.

  4. 04

    The app keeps retrying

    Also check: a loop that retries getIdToken on every error spins forever here. Stop on this code and sign out.

Checked against the vendor’s docs on : Firebase docs: Manage user sessions.

Rather hand it over?

Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.

“Very responsive, attentive to fixing bugs, and completed the project as needed! Thank you!”
A buyer in the United States, July 2022. Shopify on Fiverr
All 127 Fiverr reviews

Related: Firebase auth/requires-recent-login · Firebase auth/user-disabled · Firebase auth/invalid-verification-code · Firebase auth/id-token-expired

Questions

More on this error

Do ID tokens expire too?

Yes, after about an hour, but the SDK refreshes them on its own. This error means the refresh itself failed, so a new sign-in is needed.

Can I keep users signed in after a password change?

Not on other devices. A password or email change ends those sessions on purpose.

Can you fix it for me?

If one bug is the whole problem, the App Fix Ticket covers it: a written diagnosis first, then the fix. If the app has more going on, the Launch Check is a written check of the whole app. Each issue found is rated critical, high, medium or low, with where it is and how it was confirmed. No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way. This applies to the first 10 Launch Checks bought after October 30, 2026.

A different error?

Describe it and get a written quote

Send the error and what you were doing. You get a written scope, a fixed price and a timeline; Simon replies by email, usually within one business day.