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

After adding the blacklist successfully, the token is still authenticated successfully #1248

Open
AshuaiNe opened this issue Aug 1, 2024 · 1 comment

Comments

@AshuaiNe
Copy link

AshuaiNe commented Aug 1, 2024

settings.py
NINJA_JWT = {
'BLACKLIST_AFTER_ROTATION': True,}
INSTALLED_APPS = [ "ninja_jwt.token_blacklist",]

`
@http_post(
"/logout",
# response=UserLogoutSchema,
summary="user-logout",
url_name="user-logout",
auth=JWTAuth(),
)

def logout(self):
    headers = self.context.request.headers
    token = headers.get("Authorization").split(" ")[1]
    token = RefreshToken(token).blacklist()
    return {"code": 200, "message": "user logout"}

`

Checking JWTAuth found no interaction with the blacklist

@baseplate-admin
Copy link
Contributor

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

No branches or pull requests

2 participants