Is checkSession sync or async?

auth0.js v9.7.3

Hi,

we are developing a SPA, if an access token is in the local storage from a previous successful authentication, we’d like to make a silent authentication to avoid a new login UX disrupt.

For that we use checkSession and get a result:

  • KO: could not get a new token so need to login again
  • OK: do our business logic as it was a successful ‘non silent’ authentication

As checkSession has a callback for argument, we thought that checkSession is async (requires to contact the Auth0 server to provide the result?) but it’s so fast (less than 1ms) that we now feel that it’s synchronous.

If it can be both, for which cases it’s synch. and which cases it’s async.?

Thanks

Hey there!

Sorry for such delay in response! We’re doing our best in providing the best developer support experience out there, but sometimes the number of incoming questions is just too big for our bandwidth. Sorry for such inconvenience!

Do you still require further assistance from us?