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

Should be able to unset access and refresh token cookies independently. #148

Closed
matthewstory opened this issue May 5, 2018 · 1 comment

Comments

@matthewstory
Copy link
Contributor

I am looking specifically to be able to unset access token cookies without unsetting refresh token cookies.

My reason for this is that I am handling JWTs before dispatching to the view function (i have written a JWT session extension) and I would like to return a 401 when I receive an expired token and then remove only the access tokens in that response, preserving the refresh tokens should the user choose to refresh but allowing subsequent requests to be made without an access token (empty session) rather than with an invalid access token (unresolvable 401).

I am proposing introducing two new functions:

unset_access_cookies
unset_refresh_cookies

symmetrical to the set_*_cookies functions in addition to the existing unset_jwt_cookes function.

I have a work-around in place, but it's far more elegant to make this change and I think it's probably generally useful.

PR incoming.

matthewstory added a commit to matthewstory/flask-jwt-extended that referenced this issue May 5, 2018
@matthewstory matthewstory changed the title Should be able to unset access and refresh tokens independently. Should be able to unset access and refresh token cookies independently. May 5, 2018
vimalloc added a commit that referenced this issue May 5, 2018
[#148] add unset_access_cookies and unset_refresh_cookies functions
@vimalloc
Copy link
Owner

vimalloc commented May 5, 2018

Released in v3.8.2. Cheers 👍

@vimalloc vimalloc closed this as completed May 5, 2018
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