diff --git a/frontend/src/lib/api.ts b/frontend/src/lib/api.ts index c169e2d..acf70c0 100644 --- a/frontend/src/lib/api.ts +++ b/frontend/src/lib/api.ts @@ -13,7 +13,11 @@ api.interceptors.response.use( (response) => response, (error) => { if (error.response?.status === 401) { - window.location.href = '/login'; + const url = error.config?.url || ''; + // Don't redirect on auth endpoints — they legitimately return 401 + if (!url.startsWith('/auth/')) { + window.location.href = '/login'; + } } return Promise.reject(error); }