diff --git a/api/server/experimental.js b/api/server/experimental.js index d6b610a595..92cac2099b 100644 --- a/api/server/experimental.js +++ b/api/server/experimental.js @@ -541,7 +541,6 @@ if (cluster.isMaster) { so the answer is the deployment's base configuration, like index.js. */ indexHTML = injectConfiguredFooterBootstrap(indexHTML, { customFooter: process.env.CUSTOM_FOOTER, - interfaceConfig: baseAppConfig?.interfaceConfig, }); const cspPolicy = createCspPolicy(); diff --git a/api/server/index.js b/api/server/index.js index b4555e7b26..b83d2cc003 100644 --- a/api/server/index.js +++ b/api/server/index.js @@ -292,7 +292,6 @@ const startServer = async () => { caller's and the client prefers it. */ indexHTML = injectConfiguredFooterBootstrap(indexHTML, { customFooter: process.env.CUSTOM_FOOTER, - interfaceConfig: appConfig?.interfaceConfig, }); const cspPolicy = createCspPolicy(); diff --git a/client/src/components/Auth/AuthLayout.tsx b/client/src/components/Auth/AuthLayout.tsx index 57fa4e5d86..bb05dd0cb4 100644 --- a/client/src/components/Auth/AuthLayout.tsx +++ b/client/src/components/Auth/AuthLayout.tsx @@ -1,9 +1,11 @@ import { ThemeSelector } from '@librechat/client'; import { TStartupConfig } from 'librechat-data-provider'; import { ErrorMessage } from '~/components/Auth/ErrorMessage'; +import { hasPublishedPolicies } from '~/utils/policies'; import { TranslationKeys, useLocalize } from '~/hooks'; import SocialLoginRender from './SocialLoginRender'; import { BlinkAnimation } from './BlinkAnimation'; +import LegalConsent from './LegalConsent'; import { Banner } from '../Banners'; import Footer from './Footer'; @@ -27,6 +29,30 @@ function AuthLayout({ const localize = useLocalize(); const hasStartupConfigError = startupConfigError !== null && startupConfigError !== undefined; + const isRegister = pathname.includes('register'); + const isLogin = !pathname.includes('2fa') && pathname.includes('login'); + const showsSocialLogin = isLogin || isRegister; + /** Both ways in state it, rather than the layout guessing which of them can + * create an account. That guess is not available here: account creation + * also happens on a first provider sign-in, on a first LDAP sign-in through + * the ordinary form, and is gated server-side by ALLOW_SOCIAL_REGISTRATION, + * which the startup payload does not carry. The sentence is about + * continuing, which is what both screens do, and it names the same policies + * the footer bar linked, so a screen states them once. */ + const hasPolicies = hasPublishedPolicies(startupConfig); + /** Registration states it under its own submit button, where it is read + * before the account is created rather than below however many provider + * buttons a deployment configured, and it renders that form only once the + * config has loaded without error. The login screen has no submit button of + * its own to sit under, so there the layout states it below the providers, + * for as long as it knows the policies: a background refetch must not swap + * the sentence for the bar and back. */ + const registrationStatesConsent = + isRegister && hasPolicies && !hasStartupConfigError && !isFetching; + const statesConsentBelowProviders = isLogin && hasPolicies; + /** The bar is dropped exactly when the sentence is on the screen, so a + * reader never meets both and never meets neither. */ + const statesConsent = registrationStatesConsent || statesConsentBelowProviders; const DisplayError = () => { if (hasStartupConfigError) { return ( @@ -87,13 +113,11 @@ function AuthLayout({ )} {children} - {!pathname.includes('2fa') && - (pathname.includes('login') || pathname.includes('register')) && ( - - )} + {showsSocialLogin && } + {statesConsentBelowProviders && } -