Node js, JWT token and logic behind

后端 未结 4 2104
别跟我提以往
别跟我提以往 2020-12-28 21:50

I\'m using the JWT to protect node js urls https://github.com/auth0/express-jwt

To create a JWT token user session i simply do:

-> auth/signup
            


        
4条回答
  •  清歌不尽
    2020-12-28 22:13

    1. You need to store the token on the client side (local storage or cookie)

    2. Yes. HTTP is stateless. If you don't verify it every time, someone could call your URL without the token or with an invalid token. If you are worried about performance, an HMACSHA256 check is very fast.

    3. That doesn't make sense, you must be doing something wrong.

提交回复
热议问题