- Symptom
- getRedirectResult() resolves to null after a successful Google sign-inUnable to process request due to missing initial state. This may happen if browser sessionStorage is inaccessible or accidentally cleared.Works on localhost and in signInWithPopup, fails on the deployed custom domain
- Cause
- The redirect flow keeps state on the authDomain helper page, and browsers now partition third-party storage, so when authDomain differs from the app's domain the state is lost. Chrome 115 and later enforced this from June 24, 2024, after Safari 16.1 and Firefox 109.
- Fix
- Serve the auth helper from your own domain: set authDomain to the app's domain on Firebase Hosting, or reverse proxy /__/auth/ to PROJECT_ID.firebaseapp.com, and add the new redirect URI at the OAuth provider. Otherwise switch to signInWithPopup.
- Apply
initializeApp({ apiKey: '...', authDomain: 'app.example.com', // same domain that serves the app, proxying /__/auth/* projectId: '...', }); // OAuth provider redirect URI: https://app.example.com/__/auth/handler- Affected
- Firebase JS SDK redirect sign-in on Chrome 115+ (from 2024-06-24), Safari 16.1+, Firefox 109+, when authDomain is not the app's own domain
- Sources
Last verified 2026-10-15 · Confirmed by 0 builders