mirror of
https://github.com/neynarxyz/create-farcaster-mini-app.git
synced 2025-12-07 01:42:31 -05:00
fix: siwn csrf config
This commit is contained in:
14
src/auth.ts
14
src/auth.ts
@@ -274,7 +274,7 @@ export const authOptions: AuthOptions = {
|
||||
? `https://${process.env.VERCEL_PROJECT_PRODUCTION_URL}`
|
||||
: process.env.VERCEL_URL
|
||||
? `https://${process.env.VERCEL_URL}`
|
||||
: `http://localhost:${process.env.PORT ?? 3000}`;
|
||||
: process.env.NEXTAUTH_URL || `http://localhost:${process.env.PORT ?? 3000}`;
|
||||
|
||||
const domain = getDomainFromUrl(baseUrl);
|
||||
|
||||
@@ -339,26 +339,26 @@ export const authOptions: AuthOptions = {
|
||||
name: `next-auth.session-token`,
|
||||
options: {
|
||||
httpOnly: true,
|
||||
sameSite: 'none',
|
||||
sameSite: process.env.NODE_ENV === 'production' ? 'none' : 'lax',
|
||||
path: '/',
|
||||
secure: true,
|
||||
secure: process.env.NODE_ENV === 'production',
|
||||
},
|
||||
},
|
||||
callbackUrl: {
|
||||
name: `next-auth.callback-url`,
|
||||
options: {
|
||||
sameSite: 'none',
|
||||
sameSite: process.env.NODE_ENV === 'production' ? 'none' : 'lax',
|
||||
path: '/',
|
||||
secure: true,
|
||||
secure: process.env.NODE_ENV === 'production',
|
||||
},
|
||||
},
|
||||
csrfToken: {
|
||||
name: `next-auth.csrf-token`,
|
||||
options: {
|
||||
httpOnly: true,
|
||||
sameSite: 'none',
|
||||
sameSite: process.env.NODE_ENV === 'production' ? 'none' : 'lax',
|
||||
path: '/',
|
||||
secure: true,
|
||||
secure: process.env.NODE_ENV === 'production',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -569,6 +569,8 @@ export function NeynarAuthButton() {
|
||||
} else {
|
||||
console.error('❌ Backend sign-in error:', e);
|
||||
}
|
||||
} finally {
|
||||
setSignersLoading(false);
|
||||
}
|
||||
}, [nonce]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user