You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My SPA uses many different access tokens. Because fetching these tokens can take several seconds, I wrote code to pre-load them all at app startup, rather than waiting until the user clicks on a specific widget to load the token for that particular API. Since getAccessTokenSilently() returns a promise, I thought I was fetching these tokens in parallel. I can verify that the calls to getAccessTokenSilently() all occur synchronously, within a few milliseconds (in other words, they're behaving as I expect). But a closer inspection of the Network tab reveals that the actual requests to {my-app}.auth0.com/oauth/token are queued up and executed one at a time. I'm not sure where or why this queueing is happening.
Describe the ideal solution
Ideally, these requests would just happen in parallel (up to some reasonable number of connections, perhaps).
Alternatives and current workarounds
An alternative might be a getAccessTokensSliently() method that handles batch requests.
Additional context
No response
The text was updated successfully, but these errors were encountered:
Checklist
Describe the problem you'd like to have solved
My SPA uses many different access tokens. Because fetching these tokens can take several seconds, I wrote code to pre-load them all at app startup, rather than waiting until the user clicks on a specific widget to load the token for that particular API. Since
getAccessTokenSilently()
returns a promise, I thought I was fetching these tokens in parallel. I can verify that the calls togetAccessTokenSilently()
all occur synchronously, within a few milliseconds (in other words, they're behaving as I expect). But a closer inspection of the Network tab reveals that the actual requests to{my-app}.auth0.com/oauth/token
are queued up and executed one at a time. I'm not sure where or why this queueing is happening.Describe the ideal solution
Ideally, these requests would just happen in parallel (up to some reasonable number of connections, perhaps).
Alternatives and current workarounds
An alternative might be a
getAccessTokensSliently()
method that handles batch requests.Additional context
No response
The text was updated successfully, but these errors were encountered: