You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it would be nice to have a general retry handler aswell:
constonOk=(response)=>response;constonError=(error)=>{// Return any error which is not due to authentication back to the calling serviceif(error&&error.response&&error.response.status!==401){returnPromise.reject(error);}constconfig=error.config;// Logout user if token refresh didn't work or user is disabledif(error.config.url.endsWith("auth/refresh")){logout();returnPromise.reject(error);}// Try request again with new tokenreturnnewPromise((resolve,reject)=>{requestRefresh().then((response)=>{setAuthTokens(response.data)returnhttp.request(config).then((response)=>resolve(response));}).catch((e)=>{clearAuthTokens()reject(e)})});};http.interceptors.response.use(onOk,onError);
The text was updated successfully, but these errors were encountered:
it would be nice to have a general
retry
handler aswell:The text was updated successfully, but these errors were encountered: