hyperlog-core / hyperlog-backend

Backend for hyperlog
0 stars 0 forks source link

Add 'issued_at' key in JWT to invalidate old tokens #112

Closed nikochiko closed 4 years ago

nikochiko commented 4 years ago

Changes:

The middleware will check if the value at issued_at key in JWT is the same as the user.last_login and will throw an error if both are not same. The last_login is updated at the time the JWT payload is created (during token generation). After logout, the user.last_login will be set to the time of logout which will invalidate all previous tokens.