Files
headquarter/apps/web/src/pages/placeholder.tsx
T
Fusion 1daac47951 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
2026-05-18 10:56:27 +02:00

35 lines
1.0 KiB
TypeScript

export const PlaceholderPage = ({ title }: { title: string }) => {
return (
<section className="stack">
<h1>{title}</h1>
<p className="muted">This page is part of the frontend foundation scaffold.</p>
</section>
);
};
export const NotFoundPage = () => {
return (
<section className="stack center-screen">
<h1>404</h1>
<p className="muted">The page you requested does not exist.</p>
</section>
);
};
const API_BASE_URL = import.meta.env.VITE_API_BASE_URL ?? "http://localhost:8000";
export const LoginRedirectPage = () => {
const nextPath = new URLSearchParams(window.location.search).get("next") ?? "/";
const encodedNext = encodeURIComponent(nextPath);
return (
<section className="stack center-screen">
<h1>Sign in required</h1>
<p className="muted">You need to authenticate to access this section.</p>
<a className="primary-button" href={`${API_BASE_URL}/auth/login?next=${encodedNext}`}>
Continue to login
</a>
</section>
);
};