fix: use full API URL for OAuth login redirects

In Traefik deployment, API and web are on different domains.
Frontend was using relative paths (/auth/login) which resolved
to the web domain instead of the API domain.

- Update LoginRedirectPage to use VITE_API_BASE_URL for login link
- Update apiClient 401 interceptor to redirect to full API URL
- Ensures OAuth flow works correctly with separate domains
This commit is contained in:
Fusion
2026-05-18 10:56:27 +02:00
parent d38f953dfc
commit 1daac47951
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ apiClient.interceptors.response.use(
(error) => {
const status = error?.response?.status;
if (status === 401 && !shouldSkipAuthRedirect(window.location.pathname)) {
window.location.assign("/auth/login");
window.location.assign(`${BASE_URL}/auth/login`);
}
return Promise.reject(error);
}