I am using react and auth-spa js hook. The issue is that on initial load it takes way to long to get the token. About 3-10 secs.
Some extra details:
- Using Universal Login
- Using MFA rule to only request MFA once per session
Here is my flow of the react app:
On app component mount I will redirect user to login because there is no login button. Our app lives in app.domain.com and the user should be already logged in or is logging in for the first time.
I check the URL path name and see if
State or Codeis in the redirect path. Letting me know that the user got redirected from Auth0 Universal login.
Show loading screen and get access token by
getAccessTokenSilently(). This can take any where from 3-10 seconds.
Continue with the application flow.
The problem is the getAccessTokenSilently() the first time takes way to long. Can i return an access token in the redirect? I am not sure what else can I do to load faster with the SDK