Add missing refresh token when rotate and blacklist app are enabled #213
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.