createUserWithEmailAndPassword - automatic sign-in behavior

5,584 views
Skip to first unread message

Daniel

unread,
Feb 9, 2017, 4:39:58 PM2/9/17
to Firebase Google Group
Hi,

Is there a way of using `createUserWithEmailAndPassword` without signing out the current user? The reason I'm asking is because I'm demanding that the email gets verified before the user can log-in.

Currently I need to sign out the active user, start the `createUserWithEmailAndPassword` process, call `.getCurrentUser().sendEmailVerification();` and then sign out the user immediately, leaving the app in a signed out state, until the user verifies the email and signs in again.

I would prefer to keep the active user signed in, have the `createUserWithEmailAndPassword` pass me a handle to a temporary user on which I can call `.getCurrentUser().sendEmailVerification();` and then, if necessary, to sign that temporary user out, but keep the initial user signed in.

Is there a way of doing this? I'm registering signed-in users with my backend, so sign-out, sign-in involves a bit more than just Firebase and Google Sign-In.

Kind regards,
Daniel


Kato Richardson

unread,
Feb 9, 2017, 6:19:56 PM2/9/17
to Firebase Google Group
Daniel,

Why are we calling createUser*() if we are already authenticated? In the case where you're authenticated, you can just use firebase.auth().getCurrentUser() and then call your email verification from there. Or is this intended to be some sort of administrative function? Or or we trying to link multiple accounts from different providers? Is this happening at the server or on the client?

☼, Kato


--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/e7e485bc-1cd9-4203-a704-c7cc6815305d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Kato Richardson | Developer Programs Eng | kato...@google.com | 775-235-8398

Jacob Wenger

unread,
Feb 9, 2017, 6:23:06 PM2/9/17
to fireba...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages