fix: 401 redirect respects Vite base path (/tech_mahindra/login)
This commit is contained in:
parent
7830127e96
commit
5ef5343982
@ -22,7 +22,7 @@ async function request<T>(method: string, path: string, body?: unknown): Promise
|
|||||||
if (res.status === 401) {
|
if (res.status === 401) {
|
||||||
localStorage.removeItem(TOKEN_KEY);
|
localStorage.removeItem(TOKEN_KEY);
|
||||||
localStorage.removeItem("zino_user");
|
localStorage.removeItem("zino_user");
|
||||||
window.location.href = "/login";
|
window.location.href = `${import.meta.env.BASE_URL}login`;
|
||||||
throw new Error("Unauthorized");
|
throw new Error("Unauthorized");
|
||||||
}
|
}
|
||||||
if (!res.ok) {
|
if (!res.ok) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user