DEV Community

Discussion on: How to log out when using JWT

Collapse
 
yogeshkhater profile image
Yogesh Khater • Edited

Another solution could be,

  • Store any random salt in user's DB record.
  • While encryption/decryption of the JWT tokens, we can use "your secret" + the salt.
  • On logout, update the salt.

It would make any existing JWT tokens invalid immediately without the need of a blacklist.