Auth0 Home Blog Docs

the checksession method of the javascript sdk is slow




we’re using our custom oauth provider at the moment but we decided to migrate our applications to auth0. we have several apps but the most important is a react based single page app. we’ve followed the steps in the “Auth0 JavaScript SDK Quickstart” but we’re experimenting a really long load time for the checkSession call of the SDK (what is calling the /authorize endpoint within an iframe). we’re talking about ~3-4 seconds (check the screenshot). as it is the core part of the initialization phase of our application we’d like to make it faster. a lot faster. how could we achieve this? can we increase the performance somehow?

![alt text][1]


When using checkSession you should remember to add the URL where the authorization request originates from, to the Allowed Web Origins list of your Auth0 client in the Dashboard under your client’s Settings.

Also, make sure you’re using the latest version of Auth0.js, you can always check which one is the latest in the repository:


thank you for your help @ricardo.batista !

i added our application’s domain to the allowed web origins, it wouldn’t work without that. and i’m using the auth0-js npm package so it’s the latest version for sure.