From cf8f0c9a365adce8773088b486a4bf760ef90f1b Mon Sep 17 00:00:00 2001 From: "M.Schmidt" Date: Tue, 14 Jul 2026 21:43:11 +0200 Subject: [PATCH] auto redirect to idp if no other authentication method is configured --- frontend/src/routes/login/+page.svelte | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/frontend/src/routes/login/+page.svelte b/frontend/src/routes/login/+page.svelte index 6527a482..df48ec0f 100644 --- a/frontend/src/routes/login/+page.svelte +++ b/frontend/src/routes/login/+page.svelte @@ -323,6 +323,19 @@ setupAvailable = !status.initialized; if (setupAvailable) mode = 'setup'; + // 4) Auto-redirect: when OIDC is the only auth method, skip the login page. + // Guard against loops: if the IdP returned ?error=, fall through to the UI. + if ( + oidc.enabled && + oidc.password_login_enabled === false && + oidc.authorize_endpoint && + !setupAvailable && + !page.url.searchParams.has('error') + ) { + window.location.replace(oidc.authorize_endpoint); + return; + } + booting = false; });