Hi, guys
Should I call checkSession whenever need to use an access token for API? Or should I check expire date for an access token to know whether checkSession should be called or not?
Hi, guys
Should I call checkSession whenever need to use an access token for API? Or should I check expire date for an access token to know whether checkSession should be called or not?
Hi @kuma-guy,
If the token is still valid then you can avoid the extra request.
This is handled automatically in the newer auth0-spa-js. The getTokenSilently checks for a cached token before requesting one. If you don’t have a specific reason to use auth0js, you may want to consider using auth0-spa-js as it abstracts away some of these decisions.
Hope this helps,
Dan
Thanks for replying!
I use auth0-js because I need to implement login with my own login page & UI.
I understand that auth0-spa-js support redirect login with Rock or popup login and not fully migrated auth0-js features yet.
Is that right?
If my understating is right, should I implement to checkSession like as in auth0-spa-js/getTokenSiltenly?
Yes that is correct!
Thank for quick response!
I have more confidence to implement my Auth0 integrations.
thanks again for the helps.
Good luck with your project!