Skip to content

Commit ff361f2

Browse files
committed
fix: state mismatch
1 parent e848e9e commit ff361f2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

apps/server/src/services/auth.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ export function createAuth(db: Database, env: Env) {
2929
baseURL: process.env.API_SERVER_URL || 'http://localhost:3000',
3030
trustedOrigins: ['*'],
3131

32+
// To skip state-mismatch errors
33+
// https://github.com/better-auth/better-auth/issues/4969#issuecomment-3397804378
34+
advanced: {
35+
defaultCookieAttributes: {
36+
sameSite: 'None', // this enables cross-site cookies
37+
secure: true, // required for SameSite=None
38+
},
39+
},
40+
3241
socialProviders: {
3342
google: {
3443
clientId: env.AUTH_GOOGLE_CLIENT_ID,

0 commit comments

Comments
 (0)