refac
This commit is contained in:
1 parent
e4dbfb1276
commit
97c5f52bbc
1 file changed
+3
-5
@@ -157,9 +157,7 @@
|
|||||||
const redirectPath = $page.url.searchParams.get('redirect');
|
const redirectPath = $page.url.searchParams.get('redirect');
|
||||||
const logout = $page.url.searchParams.get('logout') === 'true';
|
const logout = $page.url.searchParams.get('logout') === 'true';
|
||||||
|
|
||||||
if (logout) {
|
if ($user && !logout) {
|
||||||
await user.set(null);
|
|
||||||
} else if ($user) {
|
|
||||||
goto(redirectPath || '/');
|
goto(redirectPath || '/');
|
||||||
} else {
|
} else {
|
||||||
if (redirectPath) {
|
if (redirectPath) {
|
||||||
@@ -177,8 +175,8 @@
|
|||||||
|
|
||||||
// Auto-redirect to SSO when OAUTH_AUTO_REDIRECT is enabled and the
|
// Auto-redirect to SSO when OAUTH_AUTO_REDIRECT is enabled and the
|
||||||
// deployment is unambiguously SSO-only (single provider, no login form,
|
// deployment is unambiguously SSO-only (single provider, no login form,
|
||||||
// no LDAP). Suppressed by ?form=, ?error=, onboarding, trusted-header
|
// no LDAP). Suppressed by ?logout=true, ?form=, ?error=, onboarding,
|
||||||
// auth, or an existing session/token.
|
// trusted-header auth, or an existing session/token.
|
||||||
if ($config?.oauth?.auto_redirect && !logout && !form && !error) {
|
if ($config?.oauth?.auto_redirect && !logout && !form && !error) {
|
||||||
const providers = Object.keys($config?.oauth?.providers ?? {});
|
const providers = Object.keys($config?.oauth?.providers ?? {});
|
||||||
if (
|
if (
|
||||||
|
|||||||
Reference in new issue
Block a user