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

Add missing refresh token when rotate and blacklist app are enabled #213

Closed
wants to merge 1 commit into from

Conversation

SpicyPaper
Copy link

The simplejwt package that this project uses has a rotate and blacklist option that are really nice and easy to use.
I found something missing in the dj-rest-auth in the token_refresh url.

If ROTATE_REFRESH_TOKENS setting is set to True and blacklist app is enabled the refresh token that's sent when you call the token_refresh url is blacklisted.
The issue is that there is no new refresh token cookie sent back to the client and since the previous refresh token was blacklisted the client can't make anymore request to the server.

This PR resolve that by creating and sending back a new refresh token as a cookie to the client.

If ROTATE_REFRESH_TOKENS setting is set to True and blacklist app is enabled the refresh token that's sent when you call the token_refresh url is blacklisted.
The issue is that there is no new refresh token cookie sent back to the client.
This commit resolve that by creating and sending back a new refresh_token to the client.
@auvipy auvipy requested a review from iMerica January 25, 2021 08:16
@iMerica
Copy link
Owner

iMerica commented Feb 23, 2021

Hey @SpicyPaper,

We recently merged a PR related to refresh tokens. Sorry for the late response, but would you mind rebasing those changes into your branch?

Thanks,

Michael

@SpicyPaper
Copy link
Author

I'll try to do it asap @iMerica, ty!

@SpicyPaper
Copy link
Author

SpicyPaper commented Mar 8, 2021

Ok I've checked with the new version of the master branch and someone else also had this issue and resolved it in #227
I've tested the new master branch without my changes and it looks good, I've also checked what was done in this PR and it looks like this is a better implementation than mine, so everything is alright now.
I close the PR!

@SpicyPaper SpicyPaper closed this Mar 8, 2021
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