|
|
|
|
|
by angoragoats
755 days ago
|
|
Submit a username and password via a form over https. Your backend hashes the password, and checks it against the stored (hashed) password in your database. If it matches, the user provided the correct password. Create a session token (random string is fine) and return it to the user via a cookie in the reply. Store the session token in your database, such that you can map it to the authenticated user. Then on each subsequent request, look up the session token and you have your logged in user. This is how apps were doing it for literally decades, before JWT was invented. And most web frameworks will do all of this for you. |
|