I'm using Firebase Authentication for my web app, and customizing the redirect domain for Firebase Authentication's Google Sign-In feature so that Google's authentication page will show Continue to: mydomain.io,
I followed Firebase's documentation:
- Domain Hosting
- Add
auth.mydomain.ioto the list of authorized domains in the Firebase console
Firebase console authorized domains
- In the Google OAuth setup page, whitelist the URL of the redirect page which is
https://auth.mydomain.io/__/auth/handler
- Edit my app's JavaScript code:
const firebaseConfig = {
...
authDomain: "auth.mydomain.io",
...
}
Running my app locally, I can see my domain is properly linked to my app.
Login: Continue to mydomain.io
But, when I select a Google account to connect to, nothing happens. In the popup, I am redirected to auth.mydomain.io with a blank page & an infinite loading bar at the top
EDIT: I also have the same problem using Facebook OAuth
After maybe 10 seconds the popup closes by itself and I get the following error in my local app console:
FirebaseError: Firebase: Error (auth/popup-closed-by-user).
at createErrorInternal (assert.ts:122:1)
at _createError (assert.ts:83:1)
at popup.ts:283:1
When I change the app's JavaScript configuration to myapp.firebaseapp.com for the authDomain property, it works fine and I can login with my google account
const firebaseConfig = {
...
authDomain: "myApp.firebaseapp.com",
...
}