From 08ba24c2520281aa9f76b0f9380ddc640bba50a9 Mon Sep 17 00:00:00 2001 From: Mauricio Siu Date: Sun, 8 Feb 2026 13:32:37 -0600 Subject: [PATCH] fix(auth): update BETTER_AUTH_SECRET default value for legacy support - Changed the default value of BETTER_AUTH_SECRET to ensure compatibility for users who enabled 2FA before the introduction of the new secret. - This update maintains existing authentication functionality while transitioning to a more secure default. close https://github.com/Dokploy/dokploy/issues/3645 --- packages/server/src/constants/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/server/src/constants/index.ts b/packages/server/src/constants/index.ts index 644dabd26..de0e48a2e 100644 --- a/packages/server/src/constants/index.ts +++ b/packages/server/src/constants/index.ts @@ -5,9 +5,10 @@ export const IS_CLOUD = process.env.IS_CLOUD === "true"; export const CLEANUP_CRON_JOB = "50 23 * * *"; export const docker = new Docker(); +// When not set, use the legacy default so 2FA remains working for users who +// enabled it before BETTER_AUTH_SECRET was introduced . export const BETTER_AUTH_SECRET = - process.env.BETTER_AUTH_SECRET || - "RXu/xoLHaA1Xgs+R8a0LjVjCVOEnWISQWxw7nXxlvKo="; + process.env.BETTER_AUTH_SECRET || "better-auth-secret-123456789"; export const paths = (isServer = false) => { const BASE_PATH =