Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emailLinkSignIn not working #112

Open
gr-qft opened this issue Oct 25, 2020 · 1 comment
Open

emailLinkSignIn not working #112

gr-qft opened this issue Oct 25, 2020 · 1 comment

Comments

@gr-qft
Copy link

gr-qft commented Oct 25, 2020

When setting firebaseAuthConfig (to be given to StyledFirebaseAuth), if emailLinkSignIn
is set and url inside it is defined, the sign-in is not successful, in the sense that clicking the email link won't sign the user in (and the signInSuccessWithAuthResult callback is not invoked --- this is where I set cookies and only if the cookies are set can a user be identified as having signed in). If I don't set emailLinkSignIn then everything is working fine.

What could be the problem, and how could it be fixed?

P.S. Just a note that when I have emailLinkSignIn set, I do see the url is visited but somehow the sign-in is not successful.

Another note: if I'm already signed-in, then including emailLinkSignIn and going through a new sign-in (an email is entered, the link is clicked) will send me to the url inside emailLinkSignIn successfully.

Updated: I've found out that if url points back the auth (it's where I ask for the emails) then it will be a success. I don't understand the current behaviour or if I'm using it correctly. Any help will be appreciated.

Thanks!

@maerzhase
Copy link

maerzhase commented May 7, 2021

@gr-qft did you manage to get email link signin working? I setup the provider as follows but for me it doesn't successfully sign in

{
  provider: firebase.auth.EmailAuthProvider.PROVIDER_ID,
  // Use email link authentication and do not require password.
  // Note this setting affects new users only.
  // For pre-existing users, they will still be prompted to provide their
  // passwords on sign-in.
  signInMethod: firebase.auth.EmailAuthProvider.EMAIL_LINK_SIGN_IN_METHOD,
  // Allow the user the ability to complete sign-in cross device, including
  // the mobile apps specified in the ActionCodeSettings object below.
  forceSameDevice: false,
  // Used to define the optional firebase.auth.ActionCodeSettings if
  // additional state needs to be passed along request and whether to open
  // the link in a mobile app if it is installed.
  emailLinkSignIn: function() {
    return {
      // Additional state showPromo=1234 can be retrieved from URL on
      // sign-in completion in signInSuccess callback by checking
      // window.location.href.
      url: 'http://localhost/auth/',
      // Custom FDL domain.
      // dynamicLinkDomain: 'example.page.link',
      // Always true for email link sign-in.
      handleCodeInApp: true,
      // Whether to handle link in iOS app if installed.
      // iOS: {
      //   bundleId: 'com.example.ios'
      // },
      // // Whether to handle link in Android app if opened in an Android
      // // device.
      // android: {
      //   packageName: 'com.example.android',
      //   installApp: true,
      //   minimumVersion: '12'
      // }
    };
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants