0

I'm using the createUserWithEmailAndPassword() function of Firebase authentication to create a new user, but I'm wondering if it's possible that user a isn't auto logged in after this function. In the .then() part I send an email to verify his account.

Now I have to logout the user before sending the email. So he has to verify his account. Seems like a ugly workaround.. is there something better?

I'm using: AngularFireAuth

rafbanaan
  • 579
  • 3
  • 8
  • 28
  • There is no way to create an email/password user from the application without logging in, although a fellow developer came up with a workaround.See https://stackoverflow.com/questions/37517208/firebase-kicks-out-current-user But note that logging the user in does not necessarily grant them access to any parts of your application or data. You'll typically want to do that in e.g. server-side security rules, where you can also deny access to users whose email is not verified. – Frank van Puffelen Mar 11 '18 at 15:47
  • That's true, but when the whole application is mostly only verified. I found it a bit strange to log them out first. I will take a look at the link, thanks. – rafbanaan Mar 11 '18 at 16:09
  • 1
    There is no need to log the users out. Instead simply don't grant them access to any resources until their email address is verified. – Frank van Puffelen Mar 11 '18 at 16:14

0 Answers0