fix: login → SuperOAuth root page (redirectUrl), drop LoginPage interne
All checks were successful
CI/CD — Build & Deploy / Build & Deploy (push) Successful in 21s

This commit is contained in:
2026-03-14 10:04:20 +01:00
parent 666cf6a435
commit 34bab532be
3 changed files with 5 additions and 45 deletions

View File

@@ -10,6 +10,8 @@ interface HeaderProps {
}
export default function Header({ theme, onToggleTheme, user, onLogout }: HeaderProps) {
const loginUrl = `${import.meta.env.VITE_SUPEROAUTH_URL}?redirectUrl=${encodeURIComponent(window.location.origin + '/callback')}`;
async function handleLogout() {
await apiFetch('/auth/logout', { method: 'POST' }).catch(() => {});
onLogout();
@@ -62,12 +64,12 @@ export default function Header({ theme, onToggleTheme, user, onLogout }: HeaderP
</button>
</div>
) : (
<Link
to="/login"
<a
href={loginUrl}
className="rounded border border-od-border px-3 py-1 font-mono text-xs text-od-muted hover:border-od-accent hover:text-od-accent transition-colors"
>
Connexion
</Link>
</a>
)}
</div>