✅ How to Fix auth/unauthorized-domain
for Google Login in Firebase
🔧 Step-by-Step:
🟢 1. Go to Firebase Console
Visit: https://console.firebase.google.com/
- Select your project
- Go to Authentication (from the left sidebar)
- Click on the "Sign-in method" tab
🟢 2. Enable Google Sign-In (if not already)
- In the Sign-in providers list, click Google
- Make sure it's Enabled
- Set your project’s public-facing name
- Click Save
🟢 3. Add Authorized Domains
Still under Authentication > Sign-in method, scroll to the "Authorized domains" section.
Click "Add domain", and add the domain where your app is running, for example:
admin.ts-geosystems.com.bd
Also add:
localhost
(if you're testing locally)
✅ Make sure it includes the exact domain/subdomain you're using in your frontend (without https://
or slashes).
🟢 4. Save and Retry
After adding the correct domains:
- Clear your browser cache (optional but helps)
- Restart your frontend app
- Try logging in with Google again
🛡️ Optional Security Tip
If you're deploying to multiple environments (dev, staging, production), make sure all domains are whitelisted in Firebase under Authorized domains.
Top comments (0)