test
This commit is contained in:
@@ -33,7 +33,9 @@ class ApiClient {
|
||||
this.instance.interceptors.request.use(
|
||||
(config) => {
|
||||
const token = tokenManager.getAccessToken();
|
||||
if (token) {
|
||||
console.log('setupInterceptors request ==> ', token)
|
||||
|
||||
if(token){
|
||||
config.headers.Authorization = `Bearer ${token}`;
|
||||
}
|
||||
return config;
|
||||
@@ -45,6 +47,7 @@ class ApiClient {
|
||||
this.instance.interceptors.response.use(
|
||||
(response: AxiosResponse) => response,
|
||||
async (error: AxiosError) => {
|
||||
console.log(' this.instance.interceptors.response' );
|
||||
const originalRequest = error.config as AxiosRequestConfig & { _retry?: boolean };
|
||||
console.log('originalRequest ==> ', JSON.stringify(originalRequest));
|
||||
if (error.response?.status === 401 && !originalRequest._retry) {
|
||||
|
||||
Reference in New Issue
Block a user