fix: login page avec sélection provider → /api/v1/auth/oauth/:provider?redirectUrl
All checks were successful
CI/CD — Build & Deploy / Build & Deploy (push) Successful in 21s
All checks were successful
CI/CD — Build & Deploy / Build & Deploy (push) Successful in 21s
SuperOAuth root page ignore ?redirectUrl, les boutons de sa UI pointent vers ses propres URIs hardcodées. Fix : notre page /login construit les URLs API directement avec redirectUrl=origins.tetardtek.com/callback. Aussi : CORS_ORIGINS SuperOAuth mis à jour (origins.tetardtek.com ajouté).
This commit is contained in:
@@ -10,8 +10,6 @@ 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();
|
||||
@@ -64,12 +62,12 @@ export default function Header({ theme, onToggleTheme, user, onLogout }: HeaderP
|
||||
</button>
|
||||
</div>
|
||||
) : (
|
||||
<a
|
||||
href={loginUrl}
|
||||
<Link
|
||||
to="/login"
|
||||
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
|
||||
</a>
|
||||
</Link>
|
||||
)}
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user