β
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)