Firebase auth/unauthorized-domain after deploy
Google sign-in says this domain is not authorized, or the code is auth/unauthorized-domain? The live hostname is missing from Firebase's authorized domains.
Reviewed October 15, 2026
What it means in plain English
Sign-in works on your laptop and fails on the deployed site. Firebase's JavaScript error reference says auth/unauthorized-domain is thrown when the app domain is not authorized for OAuth operations, and that you edit the authorized domains in the Firebase console. The auth troubleshooting FAQ shows the message "This domain is not authorized to run this operation" and says the hostname in that message is the page's authDomain.
Likely causes
- The app is now on
something.vercel.app,something.netlify.app, or a custom domain, and onlylocalhostwas authorized. - The project was created after April 28, 2025. Firebase says those projects no longer include
localhostas an authorized domain by default. authDomainin the Firebase config does not match a domain that is authorized for the project.
How to fix it, step by step
- Read the hostname in the error. Firebase says that hostname is the redirect domain to check, and that it is likely missing from the authorized list or the API key is not the Browser key the SDK expects.
- Add that domain in the Firebase console. The email-link guide says: Security, then Authentication, then the Settings tab, then Authorized domains, then Add domain.
- For a project created after April 28, 2025, add
localhostyourself if you still need local sign-in. Firebase says it is not included by default, and discourages leavinglocalhoston a production project. - Confirm
authDomainin the web config is one of the domains that serve the site. The FAQ says the SDK uses it when it checks the sign-in URL.
How to check it worked
- Sign-in from the deployed origin completes.
- The console no longer reports
auth/unauthorized-domain.
Sources
Related fixes
More Firebase fixes
Keep going on your own.
The guides stay free. A deep leak report is $15. Fix packs are $24, or $49 for all three. There is no done-for-you repair.