Short answer
Sign the user out and ask them to sign in again. Then find why the saved user didn’t match: a changed Firebase config or API key, a user signed in against the Auth emulator, or a token edited in storage. Keep one config per environment so a saved user never meets another project.
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 Firebase rejects the user, and the fix
01
The app moved to another Firebase project
“The user must sign in again.” Firebase, firebase.auth.Error (auth/invalid-user-token)
The browser or device still holds a user from the old project, and the new config can’t use it. Sign out on the first error so the user signs in to the current project.
import { getAuth, signOut } from 'firebase/auth'; const auth = getAuth(); try { await auth.currentUser?.getIdToken(true); } catch (error) { if (error.code === 'auth/invalid-user-token') { await signOut(auth); showSignIn(); } }02
Emulator and production users are mixed
A user created against the Auth emulator is not valid for the production project. Use a separate origin or storage for emulator builds, or sign out when switching.
03
The token was changed in storage
Edited or copied auth data in IndexedDB or local storage is rejected. Don’t write to Firebase’s persisted auth state; sign in again to get a fresh token.
04
The app treats it like an expired token
Also check: unlike auth/user-token-expired, the SDK does not sign the user out for this code. Handle it in the app, or the stale user stays in currentUser.
Checked against the vendor’s docs on : Firebase reference: firebase.auth.Error; Firebase JS SDK source: auth errors; Firebase JS SDK source: server error mapping.
Rather hand it over?
Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.
- from $450App Fix TicketOne reproducible bug in an existing mobile or web app, diagnosed and fixed.See scope and start
- from $450AI-Built App RescueA Lovable, Bolt or Cursor app checked end to end in 3 days, then its worst problems fixed at a fixed price.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/user-token-expired · Firebase auth/invalid-api-key in production · Firebase auth/user-disabled · Firebase missing-or-invalid-nonce