Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Add TokenBlacklistView to JWT URLs #839

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

CHIHCHIEH-LAI
Copy link

This pull request adds support for blacklisting JWT refresh tokens in the Djoser authentication package, which integrates with Django Rest Framework's SimpleJWT package.

By default, Djoser supports JWT token obtain and refresh functionalities. However, in certain scenarios, it is necessary to invalidate refresh tokens. To address this, I have added a new URL pattern to support the blacklisting of refresh tokens:

re_path(r"^jwt/blacklist/?", views.TokenBlacklistView.as_view(), name="jwt-blacklist"),

Changes:
Added TokenBlacklistView to JWT URLs to handle refresh token blacklisting.

Documentation:
To ensure proper functionality, it is essential to update the documentation to include the following addition to the INSTALLED_APPS setting in Django:

INSTALLED_APPS = (
    ...
    'rest_framework_simplejwt.token_blacklist',
    ...
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant