You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix user_id type mismatch when user claim is not pk (#851)
* Fix user_id type mismatch when user claim is not pk
Regarding changes made at https://github.com/jazzband/djangorestframework-simplejwt/pull/806/files
We're using a USER_ID_CLAIM that is neither the primary key field nor is it the
same type as the primary key, and these previous changes fail at this point
when attempting to create an OutstandingToken, because it assumes that the ID
pulled out of the token claims is usable as the database key for a user.
So to mitigate this gets the user from the database using the USER_ID_FIELD
setting and uses that in the get_or_create call.
Also include a test of handling the case where the user is deleted when the
token is blacklisted.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: Josh Gardner <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
0 commit comments