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 fixes one reproducible bug at a fixed price, with an optional Diagnosis that is credited toward the fix.
Why the session ended, and the fix
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'); } }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.
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.
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.
- from $450App Fix TicketOne reproducible bug. The Fix costs $1,200. If you need a Diagnosis first, its $450 fee counts toward the Fix.See scope and start
- from $450AI-Built App RescueFor a whole-app review, the $450 Launch Check is credited toward the optional $1,950 Rescue Sprint for up to five critical or high findings.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.See scope and start
“Very responsive, attentive to fixing bugs, and completed the project as needed! Thank you!”
Related: Firebase auth/requires-recent-login · Firebase auth/user-disabled · Firebase auth/invalid-verification-code · Firebase auth/invalid-user-token