Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active
TypeScript aianthropicartifactsawsazurechatgptchatgpt-cloneclaudeclonedeepseekgeminigooglegpt-5librechatmcpo1openairesponses-apivisionwebui
📧 feat: disable login (ALLOW_EMAIL_LOGIN) (#1282)
Marco Berettafdb65366d785
diff --git a/.env.example b/.env.exampleindex 0869b28a1a..8646f775b7 100644--- a/.env.example+++ b/.env.example@@ -214,6 +214,7 @@ CHECK_BALANCE=false# Registration and Login ##========================#+ALLOW_EMAIL_LOGIN=trueALLOW_REGISTRATION=trueALLOW_SOCIAL_LOGIN=falseALLOW_SOCIAL_REGISTRATION=falsediff --git a/api/server/routes/__tests__/config.spec.js b/api/server/routes/__tests__/config.spec.jsindex 9194d458f0..4833b83d10 100644--- a/api/server/routes/__tests__/config.spec.js+++ b/api/server/routes/__tests__/config.spec.js@@ -62,6 +62,7 @@ describe.skip('GET /', () => {githubLoginEnabled: true,discordLoginEnabled: true,serverDomain: 'http://test-server.com',+ emailLoginEnabled: 'true',registrationEnabled: 'true',socialLoginEnabled: 'true',});diff --git a/api/server/routes/config.js b/api/server/routes/config.jsindex c18d35541b..9c02aa53fe 100644--- a/api/server/routes/config.js+++ b/api/server/routes/config.js@@ -1,6 +1,8 @@const express = require('express');const router = express.Router();const { isEnabled } = require('../utils');+const emailLoginEnabled =+ process.env.ALLOW_EMAIL_LOGIN === undefined || isEnabled(process.env.ALLOW_EMAIL_LOGIN);router.get('/', async function (req, res) {try {@@ -19,6 +21,7 @@ router.get('/', async function (req, res) {githubLoginEnabled: !!process.env.GITHUB_CLIENT_ID && !!process.env.GITHUB_CLIENT_SECRET,discordLoginEnabled: !!process.env.DISCORD_CLIENT_ID && !!process.env.DISCORD_CLIENT_SECRET,serverDomain: process.env.DOMAIN_SERVER || 'http://localhost:3080',+ emailLoginEnabled,registrationEnabled: isEnabled(process.env.ALLOW_REGISTRATION),socialLoginEnabled: isEnabled(process.env.ALLOW_SOCIAL_LOGIN),emailEnabled:diff --git a/client/src/components/Auth/Login.tsx b/client/src/components/Auth/Login.tsxindex c307a24905..6cb06e428c 100644--- a/client/src/components/Auth/Login.tsx+++ b/client/src/components/Auth/Login.tsx@@ -34,7 +34,7 @@ function Login() {{localize(getLoginError(error))}</div>)}- <LoginForm onSubmit={login} />+ {startupConfig?.emailLoginEnabled && <LoginForm onSubmit={login} />}{startupConfig?.registrationEnabled && (<p className="my-4 text-center text-sm font-light text-gray-700">{' '}@@ -44,7 +44,7 @@ function Login() {</a></p>)}- {startupConfig?.socialLoginEnabled && (+ {startupConfig?.socialLoginEnabled && startupConfig?.emailLoginEnabled && (<><div className="relative mt-6 flex w-full items-center justify-center border border-t uppercase"><div className="absolute bg-white px-3 text-xs">Or</div>diff --git a/client/src/components/Auth/__tests__/Login.spec.tsx b/client/src/components/Auth/__tests__/Login.spec.tsxindex 7025779f88..08b5df766d 100644--- a/client/src/components/Auth/__tests__/Login.spec.tsx+++ b/client/src/components/Auth/__tests__/Login.spec.tsx@@ -39,6 +39,7 @@ const setup = ({githubLoginEnabled: true,discordLoginEnabled: true,registrationEnabled: true,+ emailLoginEnabled: true,socialLoginEnabled: true,serverDomain: 'mock-server',},diff --git a/client/src/components/Auth/__tests__/Registration.spec.tsx b/client/src/components/Auth/__tests__/Registration.spec.tsxindex 5d2a68a2ce..19877174ec 100644--- a/client/src/components/Auth/__tests__/Registration.spec.tsx+++ b/client/src/components/Auth/__tests__/Registration.spec.tsx@@ -39,6 +39,7 @@ const setup = ({openidImageUrl: 'http://test-server.com',githubLoginEnabled: true,discordLoginEnabled: true,+ emailLoginEnabled: true,registrationEnabled: true,socialLoginEnabled: true,serverDomain: 'mock-server',diff --git a/docs/install/dotenv.md b/docs/install/dotenv.mdindex 2f7a1563cf..53a7e8bb28 100644--- a/docs/install/dotenv.md+++ b/docs/install/dotenv.md@@ -507,7 +507,10 @@ CHECK_BALANCE=false### Registration and Loginsee: [User/Auth System](../install/user_auth_system.md)++- General Settings:+ - `ALLOW_EMAIL_LOGIN`: Email login. Set to `true` or `false` to enable or disable ONLY email login.- `ALLOW_REGISTRATION`: Email registration of new users. Set to `true` or `false` to enable or disable Email registration.- `ALLOW_SOCIAL_LOGIN`: Allow users to connect to LibreChat with various social networks, see below. Set to `true` or `false` to enable or disable.- `ALLOW_SOCIAL_REGISTRATION`: Enable or disable registration of new user using various social network. Set to `true` or `false` to enable or disable.@@ -668,4 +671,4 @@ Mail address for from field. It is **REQUIRED** to set a value here (even if it'```bash-```\ No newline at end of file+```diff --git a/packages/data-provider/src/types.ts b/packages/data-provider/src/types.tsindex 8b914b36f3..a05e4f4e30 100644--- a/packages/data-provider/src/types.ts+++ b/packages/data-provider/src/types.ts@@ -178,6 +178,7 @@ export type TStartupConfig = {openidImageUrl: string;discordLoginEnabled: boolean;serverDomain: string;+ emailLoginEnabled: boolean;registrationEnabled: boolean;socialLoginEnabled: boolean;emailEnabled: boolean;