fix(auth): suppress OAUTH_AUTO_REDIRECT on signout navigation to prevent logout redirect loop (#29076)

This commit is contained in:
teddiesloco 2026-08-27 18:55:36 +07:00
parent d3e8bf3405
commit d3353bdb1d
2 changed files with 4 additions and 3 deletions

View file

@ -574,7 +574,7 @@
user.set(null);
localStorage.removeItem('token');
location.href = res?.redirect_url ?? '/auth';
location.href = res?.redirect_url ?? '/auth?signout=true';
show = false;
}}
>

View file

@ -173,9 +173,10 @@
// Auto-redirect to SSO when OAUTH_AUTO_REDIRECT is enabled and the
// deployment is unambiguously SSO-only (single provider, no login form,
// no LDAP). Suppressed by ?form=, ?error=, onboarding, trusted-header
// no LDAP). Suppressed by ?form=, ?error=, ?signout, onboarding, trusted-header
// auth, or an existing session/token.
if ($config?.oauth?.auto_redirect && !form && !error) {
const signout = $page.url.searchParams.get('signout');
if ($config?.oauth?.auto_redirect && !form && !error && !signout) {
const providers = Object.keys($config?.oauth?.providers ?? {});
if (
providers.length === 1 &&