Last Updated: Oct 2, 2024
Overview
This article provides details on the Auth0Client object taking a long time to initialize in Auth0-SPA-JS.
Applies To
- Auth0-SPA-JS
- Auth0Client
Solution
Sometimes, the createAuth0Client asynchronous method can take over 30 seconds to complete. createAuth0Client may also return undefined and produce an error when trying to access it.
This is usually due to a configuration problem between the application and the Auth0 application the user is trying to log in with. Things to check:
- Make sure that options passed to createAuth0Client include the correct client ID and domain values for the app being used.
- Ensure that the Allowed Callback URLs , Allowed Web Origins , and Allowed Logout URLs are correctly set up in the Auth0 app settings 114 for the application.
To verify the problem is addressed, check the logs 117 in the Auth0 dashboard for any failed login events, which may provide a clue as to the problem.