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

**Code:** `auth/unauthorized-domain` · **Category:** Authentication · **Seen on:** REST API

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

## 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

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/auth/firebase-auth-unauthorized-domain)
