In Auth0 React what is the best approach for the following design goals:
- Be able to get/use the access token in any React component to make API calls
- Determine when the access token is about to expire and use the refresh token to get a new access token
- Use the access token expiration time to warn the user in advance of the token expiration.
What is unclear in the Quick Start is whether getAccessTokenSilently() is making a call to Auth0 every time an access token is requested or is it reading from cacheLocation and only calling Auth0 when the access token has expired?
If the cacheLocation is memory, is there a way to get the information? If localStorage the data structure would provide all the information for our design goals.