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

Drop session cookies after refresh failure #168

Merged
merged 3 commits into from
Aug 16, 2021
Merged

Drop session cookies after refresh failure #168

merged 3 commits into from
Aug 16, 2021

Conversation

alexashley
Copy link
Contributor

@alexashley alexashley commented Aug 16, 2021

If the request to refresh the access token fails, we try to redirect to login. However, this doesn't drop the existing session cookies so the request gets stuck in loop trying and failing to refresh the token, then redirecting to /login.

This PR changes the middleware to end the session, but doesn't try to reinitiate a login. I tested this by lowering the access token lifespan to 1 minute, invalidating the session in Keycloak, and waiting for a refresh to happen.

Likely there could be some better UX here, see #167 and likely #165 would be helpful.

Copy link

@RobertKelly RobertKelly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a proper logout.

@alexashley alexashley merged commit 94454cd into main Aug 16, 2021
@alexashley alexashley deleted the failed-refresh branch August 16, 2021 15:51
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.

3 participants