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

View File

@@ -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: {