Skip to content

Chore: Add TokenBlacklistView to JWT URLs#839

Open
CHIHCHIEH-LAI wants to merge 4 commits intosunscrapers:masterfrom
CHIHCHIEH-LAI:master
Open

Chore: Add TokenBlacklistView to JWT URLs#839
CHIHCHIEH-LAI wants to merge 4 commits intosunscrapers:masterfrom
CHIHCHIEH-LAI:master

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.

2 participants