taxios check refreshtoken condition
This commit is contained in:
@@ -18,6 +18,8 @@ import { ACTIVE_POPUP } from "../utils/Config";
|
||||
import * as HelperMethods from "../utils/helperMethods";
|
||||
import { getUrl, URLS } from "./apiConfig";
|
||||
|
||||
const retryCount = 0;
|
||||
const MAX_COUNT = 10;
|
||||
let tokenRefreshing = false;
|
||||
export const setTokenRefreshing = (value) => {
|
||||
console.log("TAxios setTokenRefreshing ", value);
|
||||
@@ -133,14 +135,19 @@ export const TAxios = (
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
//RefreshToken 만료
|
||||
if (res?.data?.retCode === 402 || res?.data?.retCode === 501) {
|
||||
if (baseUrl === URLS.GET_RE_AUTHENTICATION_CODE) {
|
||||
dispatch(getAuthenticationCode());
|
||||
} else {
|
||||
if (!tokenRefreshing) {
|
||||
dispatch(getAuthenticationCode());
|
||||
}
|
||||
checkAccessToken().then((token) => {
|
||||
executeRequest(token);
|
||||
});
|
||||
}
|
||||
return;
|
||||
}
|
||||
// 602 요청 국가 불일치
|
||||
|
||||
Reference in New Issue
Block a user