Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions rest_framework_simplejwt/tokens.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,14 @@ def verify(self):
self.check_exp()

# Ensure token id is present
if api_settings.JTI_CLAIM not in self.payload:
if (
api_settings.JTI_CLAIM is not None
and api_settings.JTI_CLAIM not in self.payload
):
raise TokenError(_("Token has no id"))

self.verify_token_type()
if api_settings.TOKEN_TYPE_CLAIM is not None:
self.verify_token_type()
Comment on lines +102 to +103
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At first this seemed strange, but I remembered it's Auth0. If possible, please leave a comment mentioning how this should only apply to outside services. Customization of tokens should still stride to use the TOKEN_TYPE_CLAIM setting. A test case would be great!


def verify_token_type(self):
"""
Expand Down