Fix cross-subdomain cookie auth for frontend/API split
This commit is contained in:
@@ -24,10 +24,21 @@ export const auth = betterAuth({
|
|||||||
session: {
|
session: {
|
||||||
expiresIn: 60 * 60 * 24 * 30, // 30 days
|
expiresIn: 60 * 60 * 24 * 30, // 30 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: '.donovankelly.xyz',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
trustedOrigins: [
|
trustedOrigins: [
|
||||||
process.env.APP_URL || 'http://localhost:5173',
|
process.env.APP_URL || 'http://localhost:5173',
|
||||||
'https://todo.donovankelly.xyz',
|
'https://todo.donovankelly.xyz',
|
||||||
|
'https://app.todo.donovankelly.xyz',
|
||||||
],
|
],
|
||||||
user: {
|
user: {
|
||||||
additionalFields: {
|
additionalFields: {
|
||||||
|
|||||||
Reference in New Issue
Block a user