diff --git a/frontend/src/api/client.ts b/frontend/src/api/client.ts index c649504..1cf1144 100644 --- a/frontend/src/api/client.ts +++ b/frontend/src/api/client.ts @@ -58,8 +58,9 @@ async function request( // Global 401 handler — expired or invalid token if (response.status === 401) { localStorage.removeItem("token"); - window.location.href = "/login"; - // Throw so callers don't try to process the response + if (window.location.pathname !== "/login") { + window.location.href = "/login"; + } throw new ApiError(401, "Session expired"); }