We are using auth0.js in a static web page. Login/signup buttons are rendered dynamically depending on the login state. We are using auth0.checkSession with a callback. It takes anywhere from 500ms to 2 seconds depending on the connection for the callback to respond, even if there is no user logged in.
Got it. Can you suggest a method to quickly determine that the user is not logged in. It is ok if it takes longer to fetch a token for logged in users. This is more critical for users that had never logged in to the sites.
Its a statically hosted web page, which also has backend.
You could add a flag in localStorage (not a token or user data) indicating if the user has previously logged in. You can check that flag and do your silent auth or display the login buttons.
Although, I can’t find any examples of this process, and it seems as though checkSession is working for most users. Are you using one of our quickstarts? I am curious if your implementation is not working as intended.