-
Notifications
You must be signed in to change notification settings - Fork 695
Description
We are using the setting CHECK_REVOKE_TOKEN: True but if the user changes the password, the refresh token is not revoked, not blacklisted or anyhow even checked. I can continue refreshing my token again and again without any issues.
At the same time the hash is checked inside get_user of JWTAuthentication and producing 401 error with some code.
How all applications works:
- login (get
accessandrefreshtokens) - make api with
accesstoken, if HTTP 401 returned - refresh token - if refreshing token is failed with HTTP 401 - redirect to login + remove tokens
This is the basic flow without "special" handling of different codes.
But now this flow is broken as point 2 returns 401 (password changed) and we try to refresh token, token refreshed with HTTP 200, we trying api call and again having HTTP 401 (password changed) and going to infinite loop.
Instead we should check for the password hash on token refresh and raise HTTP 401 from there (additionally blacklisting this refresh token if blacklist is active)
What do you think guys? Does it make sense?