I have make a token in PyJWT like this:
import jwt
import datetime
payload = {
"id": 1,
"exp": datetime.datetime.utcnow() + datetime.timedelta(minutes=1000),
"iat": datetime.datetime.utcnow()
}
token = jwt.encode(payload, 'secret', algorithm='HS256')
And sent to front and also retrive my payload like this:
payload = jwt.decode(token, 'secret', algorithms=['HS256'])
And now i want to destroy token in server and logout. How to do this?
refresh token
. However I understand that you have to change whole auth architecure to add refresh tokens and that may be impossible in your case – Subjectify