We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 77c090d commit 1af72ceCopy full SHA for 1af72ce
client/src/app/axios-config/apiInit.ts
@@ -48,14 +48,24 @@ export const initInterceptors = () => {
48
try {
49
const refreshedUser = await userManager.signinSilent();
50
const access_token = refreshedUser?.access_token;
51
+
52
+ const retryCounter = error.config.retryCounter || 1;
53
54
const retryConfig = {
55
...error.config,
56
headers: {
57
...error.config.headers,
58
Authorization: `Bearer ${access_token}`,
59
},
60
};
- return axios(retryConfig);
61
62
+ // Retry limited times
63
+ if (retryCounter < 2) {
64
+ return axios({
65
+ ...retryConfig,
66
+ retryCounter: retryCounter + 1,
67
+ });
68
+ }
69
} catch (refreshError) {
70
await userManager.signoutRedirect();
71
}
0 commit comments