Conversation
e1ed14b to
45a8125
Compare
- Extend the UnAuthorizedInterceptor to try and refresh the token if we get a 401 - Keep track of inflight tokenRefreshes so we only have a single one at a time - Wait for token refresh to complete before retrying requests - Remove the backend retry logic
0244ef8 to
2088e46
Compare
While the browser is redirecting to the sign page
AlinaGoaga
approved these changes
Aug 8, 2023
Contributor
AlinaGoaga
left a comment
There was a problem hiding this comment.
Looks great, tested locally and it's working as expected!
- Proxy is a bit obscure API, it was originally used in the hope that it would be able to provide better type safety, but I couldn't figure out how to get it there. - Revert to code more similar to the original implementation which just creates a returns new simple object.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #3832
What changed?
Token refreshing is now handled by the UI, not in-request by the server.
Why was this change made?
We cannot lock the refresh process on the server well, new requests will still come in and re-trigger it etc.
How was this change implemented?
Add more logic the UI to deal with expired tokens
On the server we remove the inline token refresh logic
How did you validate the change?
Manual testing mainly:
Waterfall
Note 401s, single refresh, immediately followed by the 200s
Follow ups: