-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[PM-11476] Prevent parallel refreshToken calls #10799
[PM-11476] Prevent parallel refreshToken calls #10799
Conversation
Thank you for your contribution! We've added this to our internal Community PR board for review. |
Any feedback ? |
Thanks @Timshel for the fix! Is there anything contributors can do to get a faster review/feedback on this PR? |
Anything new? |
Hello! Thank you for your contribution. The team will be taking this into review soon, and we'll be able to perform a full assessment at that time and provide feedback on any required changes. |
Any news ? |
@trmartin4 do you have a schedule for this PR review? |
@Timshel thank you for checking in. We have pulled this into our next sprint for review, so it should be soon. Thank you for your patience. We realize that this has been open for a while, but the team has had to balance a lot of different priorities in the interim. |
Fixed Issues (1)Great job! The following issues were fixed in this Pull Request
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues foreseen with this code change. Tested locally the refresh token and the flow seems fine and nonbreaking.
Handing this off to our QA team to finish the review process. |
Just passed through QA with all ✅ Thank you so much for taking the time to contributing. This should be rolled into our next release. |
Great 😍! Thanks @Timshel |
@Patrick-Pimentel-Bitwarden thank you :) |
📔 Objective
The goal of this PR is to prevent the clients from making parallel refresh token calls.
This can introduce issues if the provider is rolling the refresh token and invalidating the old ones after use.
This is simply done by keeping the
Promise
of the current refresh call as long as it's not finished and returning it again if another call is made.Since I'm working with
Vaultwarden
I'm unsure how pertinent it is with the official server, but I believe it might make sense since it's probably way easier to handle in the client and not in the server.First time I encountered the issue is with a refresh token validity set to 5 min or less (which the client consider expired then) which then trigger a flood to refresh calls which might result in invalidating the user session.
More recently someone had the issue with the browser extension and Authentik not liking receiving the same refresh_token twice.