TripleParity / docks-api

RESTful API Server for Docks
https://tripleparity.github.io/docks-api/stack-api-spec.html
GNU General Public License v3.0
0 stars 0 forks source link

Compare JWT with user 'last updated' timestamp #54

Open egeldenhuys opened 6 years ago

egeldenhuys commented 6 years ago

Currently if a user's password is changed, all their valid tokens still remain valid.

I propose checking when the user record was last updated (Sequelize has this field already) and comparing it with the iat in the token.

This will also invalidate tokens when other fields such as roles are changed, although me might need to set the updated at manually for the user.