Home > OS >  Authenticate a user only with password
Authenticate a user only with password

Time:11-06

I'm making a Flutter application where the user has to register and log in with email and password.

Is there a way to ask the registered user to enter his password every time he wants to log in ?

The output would be like this :

Welcome back [email protected]

please type your password to enter the app

I've searched the subject in the FirebaseAuth documentation, but couldn't find any relative information.

CodePudding user response:

You can explicitly sign any current user out when loading the page. See the bottom of the documentation page on email password authentication for an example.

CodePudding user response:

Realistically and practically speaking, you would use some type of local storage to signal to your app that the user is signed in, or out. If you use page load events only to signout the user, they will be signed out when opening a new tab which would probably be annoying.

You could use an unload event to prompt the user "You will be signed out of this application when you leave this page"

Doing all of that, the onl oad event could look for that auth state variable in local storage.

  • Related