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.
This commit is contained in:
Mauricio Siu
2026-02-08 04:16:03 -06:00
parent f78819d81a
commit ff55270b52
+13 -9
View File
@@ -30,15 +30,19 @@ const { handler, api } = betterAuth({
"/organization/delete", "/organization/delete",
], ],
secret: BETTER_AUTH_SECRET, secret: BETTER_AUTH_SECRET,
advanced: { ...(!IS_CLOUD
useSecureCookies: false, ? {
defaultCookieAttributes: { advanced: {
sameSite: "lax", useSecureCookies: false,
secure: false, defaultCookieAttributes: {
httpOnly: true, sameSite: "lax",
path: "/", secure: false,
}, httpOnly: true,
}, path: "/",
},
},
}
: {}),
appName: "Dokploy", appName: "Dokploy",
socialProviders: { socialProviders: {
github: { github: {