You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create server functionality for the user to register by entering email and password;
Before saving the user's password to the database, remember to encrypt the password to keep it secure. For this, you can use the bcrypt library;
After allowing the creation of a password for all registered users, a route for user login is required. This route should validate the user's password in the database and a good strategy to keep the user logged in for a certain time is to use JWT tokens.
To keep the user logged on the cell phone, if he clicks the "Remember me" option, you can save the JWT token in the LocalStorage (Web) or AsyncStorage browser on your mobile application. If he does not select Remember, you can just keep him authenticated during a session (until you close the application).
Step by step
Create server functionality for the user to register by entering email and password;
After allowing the creation of a password for all registered users, a route for user login is required. This route should validate the user's password in the database and a good strategy to keep the user logged in for a certain time is to use JWT tokens.
References
The text was updated successfully, but these errors were encountered: