Skip to content

User architecture #88

Answered by spurtcomm
deyaditya34 asked this question in Q&A
Discussion options

You must be logged in to vote

Authentication verifies a user's identity during login by comparing the provided password with the hashed password in the database using bcrypt.compare. If the password is correct, the server generates a JWT token containing the user's ID, roles, and other claims.

Each time the token is sent with an API request, a middleware checks the token's validity. If the token is valid, the user is granted access; otherwise, access is denied.

Hope this clarification helps !

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by spurtcomm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants