codelab-friendlychat-web icon indicating copy to clipboard operation
codelab-friendlychat-web copied to clipboard

Step 5 - Cannot sign in to the web app.

Open happyskeleton opened this issue 4 years ago • 3 comments

After having successfully deployed the application I am unable to sign in on Firefox. The sign in pop-up flashes for a second and then disappears.

I've tried this on Chrome with cookies and notifications allowed and still get the same result.

Unable to proceed further with the tutorial.

happyskeleton avatar Feb 16 '21 08:02 happyskeleton

I am having the same issue, and there's no update bout this issue for more than a year now

najm07 avatar Sep 07 '22 09:09 najm07

Can you try setting a custom parameter on the auth provider to force the prompt for an account selector? I.e., your signIn function would look like:

// Signs-in Friendly Chat.
async function signIn() {
  // Sign in Firebase using popup auth and Google as the identity provider.
  var provider = new GoogleAuthProvider();
  provider.setCustomParameters({
    prompt: "select_account"
  });
  await signInWithPopup(getAuth(), provider);
}

This seems to resolve the issue for me on Firefox (can't currently reproduce in Chrome).

jenh avatar Sep 08 '22 15:09 jenh

It seems that http://127.0.0.1 isn't a authorized domain, so accessing by http://localhost works for me!

With that code and on http://127.0.0.1, you'll see the errors.

signInWithPopup(getAuth(), provider)
      .then((result) => {
        //success
      })
      .catch((error) => {
        console.log("ErrorCode:" + error.code);
        console.log("ErrorMessage:" + error.message);
      });

Errors on Console: ErrorCode:auth/unauthorized-domain ErrorMessage:Firebase: Error (auth/unauthorized-domain).

brunopeternella avatar Dec 21 '23 21:12 brunopeternella