To create a userToken, we need the token payload and the secret key after which it returns the token. const token = jwt.sign(data, "secretkey"); Instead of hard-coding the word secretKey (or any word) as a secret key, is it a good practice to user p...
GLPGustavo and 2 more commentedLet's say we have the following scenario: A user login with correct credentials and he gets a token with expiration date. After some time (lets say 30 minutes) the token is expired and the user has to give again his credentials to be authorized. Our ...
NSNNikosDev and 2 more commentedWhat are the main security threats of SPAs and how to avoid them? How to implement authorization in SPA? For example, if an user tries to access a page for which he/she doesn't have rights, redirect user to an error page? Thank you!
PPankaj and 1 more commentedI am struggling for a stable answer for this question and not getting any. My doubts are Do we need to store the username and password in the token and if yes then how that i.e where this data are getting store in the payload part is it in the s...
GGabor commented