Google Firebase Auth Failed on Netlify, But work on local server

Viewed 2115

When I deploy my site to netlify, I cannot sign in properly, new google window open and close automatically, my site Clock

function SignIn() {
const signInWithGoogle = () => {
  const provider = new firebase.auth.GoogleAuthProvider();
  auth.signInWithPopup(provider);
};

return (
  <>
    <button className="sign" onClick={signInWithGoogle}>
      Sign in with Google
    </button>
  </>
);

}

function SignOut() {
return (
  auth.currentUser && (
    <button className="sign" onClick={() => auth.signOut()}>
      Sign Out
    </button>
  )
);

}

Picture

It only happen in web after I deploy it on netlify, and works normally in local server

1 Answers
Related