Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase Auth using Google Sign-in for Web not working

I m just exploring Firebase. I ve set up Firebse Auth using Google sign-in. It just works perfectly in my local while running from my local server. I tried to push it to my github pages, the authentication part failed to work. I ve used signinWithRedirect(), provided the code below. The result of the request is always an object with user:null and it redirects to about:blank. Could someone help me out, thanks in advance.

  var provider = new firebase.auth.GoogleAuthProvider();
  firebase.auth().signInWithRedirect(provider);
  firebase.auth().getRedirectResult().then(function(result) {
    var token = result.credential.accessToken;
    currentUser = result.user;
    console.log(token);
  });
like image 667
Jefree Sujit Avatar asked Jan 25 '26 05:01

Jefree Sujit


1 Answers

I have the same issue here. That's happening because you didn't authorized your domain to run this operation. In the Firebase console, open the Auth section. On the Sign in method tab, add your domain to the OAuth redirect domains list.

like image 155
Nivaldo Gomes Avatar answered Jan 26 '26 19:01

Nivaldo Gomes