Skip to content

Commit

Permalink
fix: use normal cookies on development mode
Browse files Browse the repository at this point in the history
  • Loading branch information
SegaraRai committed Dec 4, 2023
1 parent dd60ecc commit 8710cc9
Showing 1 changed file with 25 additions and 19 deletions.
44 changes: 25 additions & 19 deletions server/api/auth/[...].ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,31 @@ export const authOptions: AuthConfig = {
pages: {
signIn: "/signin",
},
cookies: {
callbackUrl: {
name: "auth.callback-url",
options: {
httpOnly: true,
sameSite: "lax",
secure: true,
},
},
sessionToken: {
name: "auth.session-token",
options: {
httpOnly: true,
sameSite: "lax",
secure: true,
},
},
},
useSecureCookies: true,
...(process.env.NODE_ENV === "development"
? {}
: {
cookies: {
callbackUrl: {
name: "__Secure-authjs.callback-url",
options: {
httpOnly: true,
sameSite: "lax",
path: "/",
secure: true,
},
},
sessionToken: {
name: "__Secure-authjs.session-token",
options: {
httpOnly: true,
sameSite: "lax",
path: "/",
secure: true,
},
},
},
useSecureCookies: true,
}),
providers: [
Credentials({
credentials: {
Expand Down

0 comments on commit 8710cc9

Please sign in to comment.