2

jwt blacklist a valide token

For my API i'm using this package jwt-node for authentication

after sending a POST req to /users with a valid form data it will create a userr

/users [POST] 

after that to login he will send us POST req to /users/login with email and password and he will get a token valid token for 1 day

/users/login [POST]

now if the user would like to delete his account he will send DELETE request to /users and i will delete his account

/users [DELETE]

but the problem is the token will be valid for 1 day so even if his account is not available he has a valid token

is there way to invalidate a token with JWT or add it to blacklist

0 Answers0