Flutter - remove auto login after registration in Firebase

Viewed 3066

I've got a problem with registration in Flutter. As far as I see, firebase sign in user automatically after registration. I want to prevent this action, because in my app every user must be confirmed.

I saw the solution for this case in other topic but IMO, calling signout after registration isn't good idea because we need to do additional step. Is there any possibility to remove sign in after registration in prettier way?

Thanks!

1 Answers

Creating an account from the client-side Firebase Authentication SDKs automatically signs that user in. There is no way to prevent this.

Also see:


If you want to prevent a user from using the application until they've confirmed their email address, that is an authorization question.

The approach here is two-step:

  1. In your application code you check if they've verified their email address, and only redirect them to the main screen if they have.
  2. In any server-side code you decode the ID token, and check if the email address is verified.

Also see:

Related