Rahul Saini
Rahul Saini

Reputation: 937

How to Implement logout functionality by using jsonwebtoken in nodejs

we know, that first approached is to delete cookie of browser.

But I want to know how to destroy token from server side or how to check logout functionality from server side.

Upvotes: 0

Views: 1701

Answers (2)

Rogue45
Rogue45

Reputation: 381

Possible solution I've been thinking about is implementing a throttling mechanism to limit how many times the token can be used within its usage window. I think you would only need the last token used for a user and to invalidate it set the count to its max.

Upvotes: 0

Duane Desouza
Duane Desouza

Reputation: 61

I don't think it is possible using JWT. Instead you can blacklist the token.

Take a look at https://auth0.com/blog/blacklist-json-web-token-api-keys/

Upvotes: 3

Related Questions