I’m using the Auth0’s React SDK.
All the examples call getAccessTokenSilently just before making the API call. This includes examples that call API in the useEffect() as well as example that call useAPI() hook.
My App has a higher level auth provider and it calls the getAccessTokenSilently to obtain the accessToken and then provides it to all the children components.
I’m wondering if this is a sane strategy or not as opposed to calling getAccessTokenSilently on-demand right before making an API call.
- Which SDK this is regarding: auth0-react
- SDK Version: 1.2.0
- Platform Version: Mac OS X
Code Snippets/Error Messages/Supporting Details/Screenshots:
*Is this a feature request or bug report? No