Get Silent access token takes way to long on initial load

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:

  1. Using Universal Login
  2. Using MFA rule to only request MFA once per session

Here is my flow of the react app:

  1. On app component mount I will redirect user to login because there is no login button. Our app lives in and the user should be already logged in or is logging in for the first time.

  2. I check the URL path name and see if State or Code is in the redirect path. Letting me know that the user got redirected from Auth0 Universal login.

  3. Show loading screen and get access token by getAccessTokenSilently(). This can take any where from 3-10 seconds.

  4. 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

Hi do you have an update for this issue? I’m running into the same problem where I have to wait for an access token before loading the application and it’s currently taking a few seconds.