axios fix bug

This commit is contained in:
hamid zarghami
2025-02-01 14:08:35 +03:30
parent 893f5e2c8d
commit 0f32a3382f
+2 -1
View File
@@ -1,4 +1,5 @@
import axios from "axios";
import { Pages } from "./Pages";
const axiosInstance = axios.create({
baseURL: import.meta.env.VITE_BASE_URL,
@@ -9,7 +10,7 @@ axiosInstance.interceptors.response.use(
(error) => {
if (error.response.status === 401) {
localStorage.removeItem(import.meta.env.VITE_TOKEN_NAME);
window.location.href = "/auth";
window.location.href = Pages.auth.login;
}
return Promise.reject(error);
}