I have a firebase web app the google sign in popup doesn't work it doesn't last or give me a message (check the picture) is there a soution
//sign in with google
const googleProvider = new GoogleAuthProvider();
const signInWithGoogle = document.querySelector('#google-icon');
signInWithGoogle.addEventListener('click', (e) => {
e.preventDefault();
signInWithPopup(auth, googleProvider).then((result) => {
const user = result.user;
const credential = GoogleAuthProvider.credentialFromResult(result);
const accessToken = credential.accessToken;})
.catch((error) => {
const errorCode = error.code;
const errorMessage = error.message;
const email = error.email;
const credential = GoogleAuthProvider.credentialFromError(error);
});
});
I had the same problem while playing around with firebase auth. My problem was that http://127.0.0.1:3000/ wasn't authorized.
After I switched to http://localhost:3000/ everything worked fine.