firebase/firebaseui-web-react

Email Link Sign In Configuration

beebox opened this issue · 1 comments

I'm getting a 404 when trying to test email link sign in on localhost. I've followed the advice in #88 and tried changing SignInFlow to redirect.

signInFlow: firebase.auth().isSignInWithEmailLink(window.location.href) ? 'redirect' : 'popup'

Is there any further configuration needed to get email link sign in working?

Thank you for any advice

After this fix all working for me. My config:

const uiConfig = {
  signInFlow: firebase.auth().isSignInWithEmailLink(window.location.href) ? 'redirect' : 'popup',
  signInOptions: [
    firebase.auth.GoogleAuthProvider.PROVIDER_ID,
    {
      provider: firebase.auth.EmailAuthProvider.PROVIDER_ID,
      signInMethod: firebase.auth.EmailAuthProvider.EMAIL_LINK_SIGN_IN_METHOD
    },
    {
      provider: firebase.auth.PhoneAuthProvider.PROVIDER_ID,
      defaultCountry: 'RU',
      whitelistedCountries: ['RU', '+7']
    },
    'anonymous'
  ],
  callbacks: {
    // Avoid redirects after sign-in.
    signInSuccessWithAuthResult: () => false,
  },
};