Firebase: “This domain is not authorized for OAuth operations”

You'll see:
  • auth/unauthorized-domain
  • Google sign-in popup closes immediately on your deployed site

Why it happens

Firebase only allows sign-in from domains on the Authorized domains list. Your new hosting domain isn't on it. Projects created after April 28, 2025 also don't include localhost by default.

How to fix it

  1. Add your domain

    Firebase console → Authentication → Settings → Authorized domains → Add domain. Add the bare domain (yourdomain.com), plus any preview domain you use.

  2. Add localhost for development if needed

  3. Retry in a fresh tab

Common with:

Related fixes