From ff55270b5295f5065de9392886e4416c396532f1 Mon Sep 17 00:00:00 2001 From: Mauricio Siu Date: Sun, 8 Feb 2026 04:16:03 -0600 Subject: [PATCH] refactor(auth): conditionally apply advanced cookie settings based on cloud environment - Updated the authentication configuration to conditionally include advanced cookie settings only when not in a cloud environment. - This change enhances flexibility in cookie management while maintaining existing security practices. --- packages/server/src/lib/auth.ts | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/packages/server/src/lib/auth.ts b/packages/server/src/lib/auth.ts index 32ee7131e..b6d52febb 100644 --- a/packages/server/src/lib/auth.ts +++ b/packages/server/src/lib/auth.ts @@ -30,15 +30,19 @@ const { handler, api } = betterAuth({ "/organization/delete", ], secret: BETTER_AUTH_SECRET, - advanced: { - useSecureCookies: false, - defaultCookieAttributes: { - sameSite: "lax", - secure: false, - httpOnly: true, - path: "/", - }, - }, + ...(!IS_CLOUD + ? { + advanced: { + useSecureCookies: false, + defaultCookieAttributes: { + sameSite: "lax", + secure: false, + httpOnly: true, + path: "/", + }, + }, + } + : {}), appName: "Dokploy", socialProviders: { github: {