firebaseui-web-react icon indicating copy to clipboard operation
firebaseui-web-react copied to clipboard

EmailLinkSignIn - retrieve email used

Open scotty595 opened this issue 5 years ago • 6 comments

Is there any way to retrieve the email used to send an email link without implementing a custom function/implementation of the firebaseui react?

i.e. it'd be great to have something similar to the below in the umailLinkSignIn callback:

emailLinkSignIn: function(email) {
   window.localStorage.setItem('emailForSignIn', email)
}

so we can avoid reprompting for the email.

scotty595 avatar Apr 14 '20 05:04 scotty595

When the link is opened on the same device, we do not prompt the user to provide it again. We already cache the email locally in those flows.

bojeil-google avatar Apr 14 '20 06:04 bojeil-google

perfect, once I changed the signInFlow from 'popup' to 'redirect' it started automatically logging in with the correct email address - thanks.

Still seems to be relevant if you have is set as popup signInFlow though.

have used the below in uiConfig as a workaround:

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

scotty595 avatar Apr 14 '20 06:04 scotty595

I don't think signInFlow should affect this. signInFlow affects sign-in with IdPs like Google, Facebook, Twitter, etc with popup or redirect.

bojeil-google avatar Apr 14 '20 07:04 bojeil-google

I'm seeing the same behavior. Changing signInFlow from popup to redirect fixed the issue.

michaeldoaty avatar Jun 27 '20 23:06 michaeldoaty

I'm having the same (I think) issue. When using email link authentication and pressing the link in the email, the user won't get logged in when I have signInFlow set to popup. However if signInFlow is set to redirect , it works fine.

niklaslavrell avatar Aug 03 '20 11:08 niklaslavrell

I had the same problem and it took quite a while to figure out. Setting signInFlow to redirect makes passwordless e-mail sign in work.

jmn avatar Sep 21 '20 17:09 jmn