So a user logs in successfully, and they get a valid JWT that we store as an encrypted cookie in their browser.
Later down the road, we want to revoke this user's access, and we flip a boolean on the user model in the database - hasAccess: false
- but the problem is that their cookie is still good.
To do a significant optimization, our server just looks at the token/cookie, and if it's valid, forgoes a trip to the database to look for the user model.
The only way I can think to solve this, is to store a hash of "blacklisted" usernames in memory on the server.
Does anyone know of a good way to solve this? Seen a similar problem?