Fix cross-subdomain cookie auth for frontend/API split

This commit is contained in:
2026-01-28 17:45:16 +00:00
parent 9869d3abe0
commit 03fce9f391

View File

@@ -24,10 +24,21 @@ export const auth = betterAuth({
session: {
expiresIn: 60 * 60 * 24 * 30, // 30 days
updateAge: 60 * 60 * 24, // Update session every day
cookieCache: {
enabled: true,
maxAge: 60 * 5, // 5 minutes
},
},
advanced: {
crossSubDomainCookies: {
enabled: true,
domain: '.donovankelly.xyz',
},
},
trustedOrigins: [
process.env.APP_URL || 'http://localhost:5173',
'https://todo.donovankelly.xyz',
'https://app.todo.donovankelly.xyz',
],
user: {
additionalFields: {