auth/unauthorized-domain 🔐 Authentication

Firebase Auth: auth/unauthorized-domain — This domain is not authorized for OAuth operations for your Firebase project

The site’s domain isn’t listed in Firebase Authentication → Settings → Authorized domains.

Seen on: REST API

Meaning

Firebase allows OAuth popups/redirects only from authorized domains. New production domains, preview deployments (Vercel/Netlify URLs), or 127.0.0.1 vs localhost cause it.

Common causes

  • Production/custom domain not added
  • Preview deployment domains
  • Using 127.0.0.1 instead of localhost

⚡ Quick fix

  1. Add the domain under Authentication → Settings → Authorized domains
  2. Use a stable preview domain
  3. Use localhost for local development

Detailed fix by platform

Firebase

  1. # Console → Authentication → Settings → Authorized domains → Add domain

How to diagnose

  1. Host — window.location.hostname
  2. List — Authorized domains

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.