Invalidating JSON Web Tokens

前端 未结 28 2428
夕颜
夕颜 2020-11-22 06:17

For a new node.js project I\'m working on, I\'m thinking about switching over from a cookie based session approach (by this, I mean, storing an id to a key-value store conta

28条回答
  •  长发绾君心
    2020-11-22 06:55

    An alternative would be to have a middleware script just for critical API endpoints.
    This middleware script would check in the database if the token is invalidated by an admin.
    This solution may be useful for cases where is not necessary to completely block the access of a user right away.

提交回复
热议问题