Refresh token rotation (RTR) token renewal vuejs 3

hi, i’m using the sdk for SPAs, on vuejs3 framework.

i’ve looked through the example on this link:

the last line of code is the following:
// Silently refreshing the access token will use the /token endpoint
// with ‘refresh_token’ grant and the refresh token from the cache
await auth0.getTokenSilently();

i didn’t understand how many times do i have to call the getTokenSilently… is it just once? on every route? or before each API call that uses the access token?

thanks in advance…

Hi @avishai,

Welcome to the Community!

Typically you would call getTokenSilently when you need a token for the API call. The token will be cached by default, so you will only make a call to Auth0 when the token is expired, not in memory because of a page refresh, or you ignore the cache intentionally.

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.