refresh token
This commit is contained in:
+5
-5
@@ -1,5 +1,5 @@
|
||||
import axios from "axios";
|
||||
import { Pages } from "./Pages";
|
||||
// import { Pages } from "./Pages";
|
||||
|
||||
const axiosInstance = axios.create({
|
||||
baseURL: import.meta.env.VITE_BASE_URL,
|
||||
@@ -8,10 +8,10 @@ const axiosInstance = axios.create({
|
||||
axiosInstance.interceptors.response.use(
|
||||
(response) => response,
|
||||
(error) => {
|
||||
if (error.response.status === 401) {
|
||||
localStorage.removeItem(import.meta.env.VITE_TOKEN_NAME);
|
||||
window.location.href = Pages.auth.login;
|
||||
}
|
||||
// if (error.response.status === 401) {
|
||||
// localStorage.removeItem(import.meta.env.VITE_TOKEN_NAME);
|
||||
// window.location.href = Pages.auth.login;
|
||||
// }
|
||||
return Promise.reject(error);
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user