diff --git a/backend/open_webui/main.py b/backend/open_webui/main.py index a252dc10b..c0650e444 100644 --- a/backend/open_webui/main.py +++ b/backend/open_webui/main.py @@ -2235,9 +2235,9 @@ async def get_app_config(request: Request): "features": { "auth": WEBUI_AUTH, "auth_trusted_header": bool(webui_app.state.AUTH_TRUSTED_EMAIL_HEADER), + "enable_ldap": webui_app.state.config.ENABLE_LDAP, "enable_signup": webui_app.state.config.ENABLE_SIGNUP, "enable_login_form": webui_app.state.config.ENABLE_LOGIN_FORM, - "enable_ldap_form": webui_app.state.config.ENABLE_LDAP, **( { "enable_web_search": retrieval_app.state.config.ENABLE_RAG_WEB_SEARCH, diff --git a/src/routes/auth/+page.svelte b/src/routes/auth/+page.svelte index 0c9156e7e..96a6cd1ee 100644 --- a/src/routes/auth/+page.svelte +++ b/src/routes/auth/+page.svelte @@ -20,12 +20,7 @@ let loaded = false; - let mode = - !$config?.features.enable_login_form && - Object.keys($config?.oauth?.providers ?? {}).length == 0 && - $config?.features.enable_ldap_form - ? 'ldap' - : 'signin'; + let mode = $config?.features.enable_ldap ? 'ldap' : 'signin'; let name = ''; let email = ''; @@ -34,13 +29,6 @@ let ldapUsername = ''; let ldapPassword = ''; - $: showSwitchButtonForSignInForm = - ($config?.features.enable_ldap_form && mode !== 'ldap') || - ($config?.features.enable_login_form && mode === 'ldap'); - - $: showOtherSignInMethods = - Object.keys($config?.oauth?.providers ?? {}).length > 0 || showSwitchButtonForSignInForm; - const setSessionUser = async (sessionUser) => { if (sessionUser) { console.log(sessionUser); @@ -144,12 +132,7 @@ bind:show={onboarding} getStartedHandler={() => { onboarding = false; - mode = - !$config?.features.enable_login_form && - Object.keys($config?.oauth?.providers ?? {}).length == 0 && - $config?.features.enable_ldap_form - ? 'ldap' - : 'signup'; + mode = $config?.features.enable_ldap ? 'ldap' : 'signup'; }} /> @@ -209,7 +192,7 @@ {/if} - {#if (mode === 'signup' || mode === 'ldap') && ($config?.onboarding ?? false)} + {#if $config?.onboarding ?? false}
ⓘ {$WEBUI_NAME} {$i18n.t( @@ -219,7 +202,7 @@ {/if}
- {#if $config?.features.enable_login_form || $config?.features.enable_ldap_form} + {#if $config?.features.enable_login_form}
{#if mode === 'signup'}
@@ -275,57 +258,56 @@
{/if} - - {#if $config?.features.enable_ldap_form && mode === 'ldap'} -
- -
- {:else if $config?.features.enable_login_form && mode !== 'ldap'} -
- - - {#if $config?.features.enable_signup && !($config?.onboarding ?? false)} -
+
+ {#if $config?.features.enable_login_form} + {#if mode === 'ldap'} + + {:else} + - -
+ {#if $config?.features.enable_signup && !($config?.onboarding ?? false)} +
+ {mode === 'signin' + ? $i18n.t("Don't have an account?") + : $i18n.t('Already have an account?')} + + +
+ {/if} {/if} -
- {/if} + {/if} +
- {#if showOtherSignInMethods} + {#if Object.keys($config?.oauth?.providers ?? {}).length > 0}

{#if $config?.features.enable_login_form} @@ -417,64 +399,25 @@ > {/if} +
+ {/if} - {#if showSwitchButtonForSignInForm} - - {/if} + {/if}