updated environment variable to suggested ENABLE_LOGIN_FORM

This commit is contained in:
Dillon 2024-07-24 21:44:40 -04:00
parent 4ecf9dd62d
commit 36b94ca5f5
5 changed files with 11 additions and 11 deletions

View File

@ -35,7 +35,7 @@ from config import (
DEFAULT_PROMPT_SUGGESTIONS, DEFAULT_PROMPT_SUGGESTIONS,
DEFAULT_USER_ROLE, DEFAULT_USER_ROLE,
ENABLE_SIGNUP, ENABLE_SIGNUP,
ENABLE_USERNAME_PASSWORD_LOGIN, ENABLE_LOGIN_FORM,
USER_PERMISSIONS, USER_PERMISSIONS,
WEBHOOK_URL, WEBHOOK_URL,
WEBUI_AUTH_TRUSTED_EMAIL_HEADER, WEBUI_AUTH_TRUSTED_EMAIL_HEADER,
@ -65,7 +65,7 @@ origins = ["*"]
app.state.config = AppConfig() app.state.config = AppConfig()
app.state.config.ENABLE_SIGNUP = ENABLE_SIGNUP app.state.config.ENABLE_SIGNUP = ENABLE_SIGNUP
app.state.config.ENABLE_USERNAME_PASSWORD_LOGIN = ENABLE_USERNAME_PASSWORD_LOGIN app.state.config.ENABLE_LOGIN_FORM = ENABLE_LOGIN_FORM
app.state.config.JWT_EXPIRES_IN = JWT_EXPIRES_IN app.state.config.JWT_EXPIRES_IN = JWT_EXPIRES_IN
app.state.AUTH_TRUSTED_EMAIL_HEADER = WEBUI_AUTH_TRUSTED_EMAIL_HEADER app.state.AUTH_TRUSTED_EMAIL_HEADER = WEBUI_AUTH_TRUSTED_EMAIL_HEADER
app.state.AUTH_TRUSTED_NAME_HEADER = WEBUI_AUTH_TRUSTED_NAME_HEADER app.state.AUTH_TRUSTED_NAME_HEADER = WEBUI_AUTH_TRUSTED_NAME_HEADER

View File

@ -709,10 +709,10 @@ ENABLE_SIGNUP = PersistentConfig(
), ),
) )
ENABLE_USERNAME_PASSWORD_LOGIN = PersistentConfig( ENABLE_LOGIN_FORM = PersistentConfig(
"ENABLE_USERNAME_PASSWORD_LOGIN", "ENABLE_LOGIN_FORM",
"ui.enable_username_password_login", "ui.ENABLE_LOGIN_FORM",
os.environ.get("ENABLE_USERNAME_PASSWORD_LOGIN", "True").lower() == "true", os.environ.get("ENABLE_LOGIN_FORM", "True").lower() == "true",
) )
DEFAULT_LOCALE = PersistentConfig( DEFAULT_LOCALE = PersistentConfig(

View File

@ -1995,7 +1995,7 @@ async def get_app_config():
"auth": WEBUI_AUTH, "auth": WEBUI_AUTH,
"auth_trusted_header": bool(webui_app.state.AUTH_TRUSTED_EMAIL_HEADER), "auth_trusted_header": bool(webui_app.state.AUTH_TRUSTED_EMAIL_HEADER),
"enable_signup": webui_app.state.config.ENABLE_SIGNUP, "enable_signup": webui_app.state.config.ENABLE_SIGNUP,
"enable_username_password_login": webui_app.state.config.ENABLE_USERNAME_PASSWORD_LOGIN, "enable_login_form": webui_app.state.config.ENABLE_LOGIN_FORM,
"enable_web_search": rag_app.state.config.ENABLE_RAG_WEB_SEARCH, "enable_web_search": rag_app.state.config.ENABLE_RAG_WEB_SEARCH,
"enable_image_generation": images_app.state.config.ENABLED, "enable_image_generation": images_app.state.config.ENABLED,
"enable_community_sharing": webui_app.state.config.ENABLE_COMMUNITY_SHARING, "enable_community_sharing": webui_app.state.config.ENABLE_COMMUNITY_SHARING,

View File

@ -145,7 +145,7 @@ type Config = {
auth: boolean; auth: boolean;
auth_trusted_header: boolean; auth_trusted_header: boolean;
enable_signup: boolean; enable_signup: boolean;
enable_username_password_login: boolean; enable_login_form: boolean;
enable_web_search?: boolean; enable_web_search?: boolean;
enable_image_generation: boolean; enable_image_generation: boolean;
enable_admin_export: boolean; enable_admin_export: boolean;

View File

@ -173,7 +173,7 @@
{/if} {/if}
</div> </div>
{#if $config?.features.enable_username_password_login} {#if $config?.features.enable_login_form}
<div class="flex flex-col mt-4"> <div class="flex flex-col mt-4">
{#if mode === 'signup'} {#if mode === 'signup'}
<div> <div>
@ -218,7 +218,7 @@
</div> </div>
{/if} {/if}
{#if $config?.features.enable_username_password_login} {#if $config?.features.enable_login_form}
<div class="mt-5"> <div class="mt-5">
<button <button
class=" bg-gray-900 hover:bg-gray-800 w-full rounded-2xl text-white font-medium text-sm py-3 transition" class=" bg-gray-900 hover:bg-gray-800 w-full rounded-2xl text-white font-medium text-sm py-3 transition"
@ -255,7 +255,7 @@
{#if Object.keys($config?.oauth?.providers ?? {}).length > 0} {#if Object.keys($config?.oauth?.providers ?? {}).length > 0}
<div class="inline-flex items-center justify-center w-full"> <div class="inline-flex items-center justify-center w-full">
<hr class="w-64 h-px my-8 bg-gray-200 border-0 dark:bg-gray-700" /> <hr class="w-64 h-px my-8 bg-gray-200 border-0 dark:bg-gray-700" />
{#if $config?.features.enable_username_password_login} {#if $config?.features.enable_login_form}
<span <span
class="absolute px-3 font-medium text-gray-900 -translate-x-1/2 bg-white left-1/2 dark:text-white dark:bg-gray-950" class="absolute px-3 font-medium text-gray-900 -translate-x-1/2 bg-white left-1/2 dark:text-white dark:bg-gray-950"
>{$i18n.t('or')}</span >{$i18n.t('or')}</span