fix: enable cross-subdomain cookies for session sharing
This commit is contained in:
@@ -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',
|
||||||
|
|||||||
Reference in New Issue
Block a user