From 6fe74d92a207c1356377764e8db1d3b53bd966d1 Mon Sep 17 00:00:00 2001 From: Nandgopal-R Date: Tue, 10 Mar 2026 11:08:45 +0530 Subject: [PATCH] Configure cookies for cross-domain authentication --- src/api/auth/index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/api/auth/index.ts b/src/api/auth/index.ts index 270071a..ac19a10 100644 --- a/src/api/auth/index.ts +++ b/src/api/auth/index.ts @@ -26,6 +26,10 @@ export const auth = betterAuth({ }, session: { modelName: "session", + cookieCache: { + enabled: true, + maxAge: 60 * 60 * 24 * 7, // 7 days + }, }, advanced: { @@ -33,6 +37,7 @@ export const auth = betterAuth({ crossSubDomainCookies: { enabled: false, // Not subdomains, different domains entirely }, + cookieSameSite: "none", // CRITICAL: Allow cross-site cookies }, emailAndPassword: {