fix: 401 redirect respects Vite base path (/tech_mahindra/login)

This commit is contained in:
Bhanu Prakash Sai Potteri 2026-05-25 10:36:40 +05:30
parent 7830127e96
commit 5ef5343982

View File

@ -22,7 +22,7 @@ async function request<T>(method: string, path: string, body?: unknown): Promise
if (res.status === 401) {
localStorage.removeItem(TOKEN_KEY);
localStorage.removeItem("zino_user");
window.location.href = "/login";
window.location.href = `${import.meta.env.BASE_URL}login`;
throw new Error("Unauthorized");
}
if (!res.ok) {