Add LDAP and improved authentication configuration.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 9111ef36-26c8-4085-84ca-a35dc1fec1b5
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7083d608-d6d3-4a6a-9a27-6286c5109627/75b5c5a0-cf3f-429b-bffd-c6bd4e6c914d.jpg
This commit is contained in:
alphaeusmote
2025-04-10 03:15:38 +00:00
parent 3a902bc645
commit 8131136bfb
2 changed files with 246 additions and 53 deletions
+4 -3
View File
@@ -12,7 +12,7 @@ import { z } from "zod";
import 'dotenv/config';
// Authentication configuration from environment variables
const CONFIG = {
export const CONFIG = {
// Local auth configuration
LOCAL_AUTH_ENABLED: process.env.LOCAL_AUTH_ENABLED !== 'false', // Enabled by default
DISABLE_REGISTRATION: process.env.DISABLE_REGISTRATION === 'true', // Disabled by default
@@ -36,7 +36,8 @@ const CONFIG = {
OIDC_CLIENT_SECRET: process.env.OIDC_CLIENT_SECRET || '',
OIDC_CALLBACK_URL: process.env.OIDC_CALLBACK_URL || 'http://localhost:5000/api/auth/oidc/callback',
OIDC_SCOPE: process.env.OIDC_SCOPE || 'openid profile email',
OIDC_AUTO_REGISTER: process.env.OIDC_AUTO_REGISTER === 'true'
OIDC_AUTO_REGISTER: process.env.OIDC_AUTO_REGISTER === 'true',
OIDC_BUTTON_TEXT: process.env.OIDC_BUTTON_TEXT || 'Sign in with OpenID Connect'
};
declare global {
@@ -408,7 +409,7 @@ export function setupAuth(app: Express) {
registrationEnabled: !CONFIG.DISABLE_REGISTRATION,
ldapEnabled: CONFIG.LDAP_ENABLED,
oidcEnabled: CONFIG.OIDC_ENABLED,
oidcButtonText: process.env.OIDC_BUTTON_TEXT || "Sign in with OpenID Connect"
oidcButtonText: CONFIG.OIDC_BUTTON_TEXT
});
});