Reland: Switch from react-auth0-components to auth0/auth0-react (#3425) #3431
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 former has been unmaintained for 5 years. I was looking at why the login button wasn't working on first load and fell into a rabbit hole...
Regarding the update, this is fairly "straightforward". We now use the context provided with the auth0-react library instead of reinventing the wheel and having our own. The auth0 library also sets up its own callback things so we don't need to set that up manually anymore either.
The main pain point was figuring out how to know within the axios interceptors whether we were logged in or not as calling
getAccessTokenSilently
will try to log you in if you're not (do not ask me why... I already didn't have hair anymore before but it's way worse now). Turned out that we could usegetIdTokenClaims
for this. I would've loved to set/unset the interceptor based on theisAuthenticated
boolean we can get from auth0 but the interceptor also sets the base URL so we can't do that or it breaks the heartbeat request.This was reverted in #3429 after it broke staging. Once we have confirmation from the IAM team about the auth0 config we should reland this or modify it accordingly