Firebase sign-in, fixed.
Clear, sourced fixes for the Firebase Auth and Google sign-in errors that stop launches: what the error means, why it happens, and the exact steps for your framework and host.
Sign-in screen & authDomain
- Firebase authDomain: what it is, where to find it, and when to change itauthDomain is the host that runs Firebase's sign-in helper at /__/auth/handler. Where to find it, what it controls, and when to change it.
- How to change Firebase authDomain to your own domainMove Firebase Auth's authDomain to your own domain: serve /__/auth/* on Firebase Hosting or via a reverse proxy, then update redirect URIs and domains.
- What is /__/auth/handler in Firebase Auth?/__/auth/handler is Firebase Auth's sign-in helper page. Why it must be an authorized redirect URI, what it serves, and how to fix its common errors.
- How to change the app name and logo on Google sign-in for a Firebase appGoogle's sign-in screens take your app name and logo from Google Auth Platform branding, shown only after brand verification. How to change them.
- Fix "The requested action is invalid" in Firebase Google loginFirebase's sign-in handler shows "The requested action is invalid" when it rejects a request. Check the API key, Authorized domains and the handler URL.
Authorized domains
- Firebase authorized domains: where the list lives and what to addWhere Firebase authorized domains live in the console, what's on the list by default, which hosts to add, and how to change it by API or Terraform.
- Wildcards in Firebase authorized domains: what works for subdomains and previewsFirebase documents no wildcard for authorized domains. Handle subdomains, preview URLs and customer domains, with a script to automate the list.
- Firebase authorized domains not working: domain is listed, sign-in still failsDomain already in Firebase authorized domains but sign-in still fails? Check the project, exact host, protocol, cached result and API key restrictions.
- Firebase auth/unauthorized-domain on localhost and 127.0.0.1New Firebase projects no longer authorize localhost by default. Add localhost or 127.0.0.1, use the Auth emulator, or test from a LAN IP.
- Firebase auth/unauthorized-domain on Vercel: fix preview deployments and productionEach Vercel deployment gets a new URL that Firebase hasn't authorized. Add stable hosts, use branch URLs or domains, and proxy /__/auth on production.
- Firebase Auth on Netlify: fix auth/unauthorized-domain on Deploy Previews and branch deploysNetlify Deploy Previews and permalinks use new hostnames Firebase hasn't authorized. Use branch deploys, add stable hosts, and proxy /__/auth.
redirect_uri_mismatch
- Error 400: redirect_uri_mismatch, what it means and how to fix itredirect_uri_mismatch means Google got a redirect URI that isn't on your OAuth client's list. Find the exact URI your app sent and register it.
- Error 400: redirect_uri_mismatch on localhost, fixed for local devOn localhost, Google matches scheme, host and port exactly. Pin your dev server's port and register the exact http://localhost callback URI.
Popup & redirect sign-in
- Firebase Google sign-in: should you use a popup or a redirect?signInWithPopup or signInWithRedirect for Firebase Google sign-in today? A decision table covering desktop, mobile, storage partitioning and COOP.
- Why Firebase says auth/popup-blocked, and how to get the sign-in popup to openauth/popup-blocked means the browser refused Firebase's sign-in window. Call signInWithPopup first in the click, move awaits out, or redirect.
- Firebase auth/popup-closed-by-user, when it's really the user and when it isn'tauth/popup-closed-by-user means Firebase saw the sign-in window as closed. Often the user closed it, but a COOP header or an error page can cause it too.
- Firebase auth/cancelled-popup-request, why a second popup cancels the firstauth/cancelled-popup-request means a second popup sign-in started before the first ended. Block double clicks and keep sign-in out of effects.
- Firebase signInWithRedirect not working? Fix it by causeFirebase signInWithRedirect returns you signed out or getRedirectResult gives null? Fix storage partitioning, consumed results and listener timing.
- Firebase signInWithRedirect on localhost: three setups that workFirebase signInWithRedirect fails on localhost? Authorize localhost, then use a dev proxy over HTTPS, a popup in dev, or the Auth Emulator.
- signInWithRedirect in React (Vite): a minimal example that worksMinimal React + Vite example of Firebase signInWithRedirect, getRedirectResult and onAuthStateChanged that survives StrictMode and router guards.
- Fix "missing initial state" in Flutter Firebase Google sign-inFix "Unable to process request due to missing initial state" in Flutter web and Android apps using firebase_auth and google_sign_in, with Dart code.
- Firebase sign-in fails in Firefox and Safari: "missing initial state" and blocked popupsWhy Firebase redirect sign-in fails with "missing initial state" in Firefox and Safari, why Safari blocks the popup, and Firebase's five fixes.
By framework
- Firebase Google sign-in with Next.js (App Router, Vercel)Add Firebase Google sign-in to a Next.js App Router app: 'use client' setup, NEXT_PUBLIC_ env vars, authorized domains and a /__/auth rewrite on Vercel.
- Firebase Google sign-in with Vite and ReactSet up Firebase Google login in a Vite React app: VITE_ env vars, an auth context, authorized domains, and a /__/auth proxy on Netlify or Vercel.
- Firebase Google sign-in with Vue 3 and NuxtFirebase Google sign-in for Vue 3 and Nuxt: VueFire composables, a client-only Nuxt plugin, authorized domains and a Nitro routeRules proxy for /__/auth.
- Firebase Google sign-in with SvelteKitFirebase Google sign-in for SvelteKit 3 and 2: browser-only init, public env vars, authorized domains, and a handle hook that proxies /__/auth to Firebase.
- Firebase Google sign-in in Angular 20+ with AngularFireAdd Firebase Google sign-in to a standalone Angular 20+ app with AngularFire: matching versions, popup code, SSR caveats and /__/auth proxy setup.
- Set up Firebase Google sign-in in a Flutter web appSet up Google sign-in in a Flutter web app with firebase_auth: popup vs redirect, google_sign_in 7.x web changes, authorized domains and your own domain.
By host & builder
- Firebase Google sign-in on Cloudflare PagesGet Firebase Google sign-in working on Cloudflare Pages: authorize pages.dev and custom domains, and proxy /__/auth/ with a Pages Function.
- Connect a custom domain to Firebase Hosting and use it for sign-inConnect a custom domain to Firebase Hosting (TXT check, A records, SSL), then use it as authDomain so Google sign-in shows your own domain.
- Firebase Google sign-in for apps on Cloud RunSet up Firebase Google sign-in for a Cloud Run app: authorize run.app or your domain, choose a domain option, show your domain, check ID tokens.
- FlutterFlow Google sign-in with Firebase: setup, domains and the firebaseapp.com screenSet up Google sign-in in FlutterFlow with Firebase Auth, authorize test, run and custom domains, and see what changing authDomain involves.
- Firebase Auth on Replit: domains, Secrets and custom domainsFirebase Google sign-in on Replit: which replit.dev and replit.app hosts to authorize, where config goes, and what a custom domain means for authDomain.
- Fixing Firebase Google sign-in in Lovable, Bolt and Cursor appsFix Firebase Google sign-in in Lovable, Bolt.new or Cursor apps: missing preview domains, wrong config, popups in previews, plus a fix-it prompt.
- Add Firebase Google sign-in to a Webflow siteAdd Firebase Google sign-in to Webflow with a module script in custom code, authorize webflow.io and your domain, and learn why authDomain stays put.