fix: enable cross-subdomain cookies for session sharing

This commit is contained in:
2026-01-28 21:28:49 +00:00
parent 2cd64918a6
commit c4990af6e4

View File

@@ -24,6 +24,20 @@ export const auth = betterAuth({
session: { session: {
expiresIn: 60 * 60 * 24 * 7, // 7 days expiresIn: 60 * 60 * 24 * 7, // 7 days
updateAge: 60 * 60 * 24, // Update session every day updateAge: 60 * 60 * 24, // Update session every day
cookieCache: {
enabled: true,
maxAge: 60 * 5, // 5 minutes
},
},
advanced: {
crossSubDomainCookies: {
enabled: true,
domain: process.env.COOKIE_DOMAIN || '.thenetwork.donovankelly.xyz',
},
defaultCookieAttributes: {
secure: true,
sameSite: 'none',
},
}, },
trustedOrigins: [ trustedOrigins: [
process.env.APP_URL || 'http://localhost:3000', process.env.APP_URL || 'http://localhost:3000',