Correctly handle new token on 401 response code

Hello there,

I’m using Auth0 React SDK (with Golang backend), and for a new set of features, I need to add the multi-tenant capabilities to my application

But I encountered an issue : when I change the permissions (I’m using app_metada included in the token for my use case), I return a 401 response code, which means the token need to be updated

As I can see, I can call back getAccessTokenSilently, but with ignoreCache option, to force getting a new token (and change it in the browser cache)

Do you have snippets, on how I can achieve this using Axios + react ?

At the moment, I’m using Axios response interceptor like this

axios.interceptors.response.use(async function (response) {
        console.log('response');
        return response;

    }, async function (error) {

        console.log("error");

        if (401 === error.response.status) {

            console.log('401');
            await getAccessTokenSilently({ ignoreCache: true });

        } else {
            return Promise.reject(error);
        }
    });

But it seems, I need to retry the request after ? Or there is a better way to handle this case, using only the Auth0 react SDK ?

Thanks for your clues,

Kindly,
Florian