Question: In Auth0-SPA-JS, why does the
Auth0Client object take a long time to initialize?
createAuth0Client asynchronous method can take over 30 seconds to complete.
createAuth0Client may also return
undefined and produce an error when you try to access it.
This is usually down to a configuration problem between your application, and the Auth0 application you’re trying to log in with. Things to check:
- Make sure that options passed to
createAuth0Clientinclude the correct client ID and domain values for the app you’re using
- Ensure that the Allowed Callback URLs , Allowed Web Origins , and Allowed Logout URLs are correctly set up in your Auth0 app settings for your application
To verify that you’re hitting this problem, check the logs in your Auth0 dashboard for any failed login events, which may provide a clue as to the problem.
Blog post: https://auth0.com/blog/introducing-auth0-single-page-apps-spa-js-sdk/ (when and how to use the new SDK in your JS apps)
Community Announcement: JS Solution to Support Authorization Code in SPAs [Product Roadmap: Launched]