Skip to content

Commit

Permalink
Feat: cookie 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
soulchicken committed Oct 8, 2023
1 parent 9e76d4f commit 7c0522b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const nextConfig = {
NEXT_PUBLIC_ENV: process.env.NEXT_PUBLIC_ENV,

NEXTAUTH_URL: process.env.NEXTAUTH_URL,
NEXTAUTH_SECRET: process.env.NEXTAUTH_SECRET,

NEXT_PUBLIC_SOCKET_URL: process.env.NEXT_PUBLIC_SOCKET_URL,
NEXT_PUBLIC_SERVER_URL: process.env.NEXT_PUBLIC_SERVER_URL,
Expand Down
12 changes: 12 additions & 0 deletions src/pages/api/auth/[...nextauth].ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ interface SessionCallback {
}

export const authOptions: NextAuthOptions = {
cookies: {
sessionToken: {
name: 'next-auth.session-token',
options: {
httpOnly: true,
sameSite: 'lax', // 'lax' 또는 'strict' 또는 'none'
path: '/',
secure: true,
domain: '.webtoonchat.com', // 여기에 쿠키를 사용하려는 주 도메인을 입력하세요.
},
},
},
providers: [
GoogleProvider({
clientId: process.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID as string,
Expand Down

0 comments on commit 7c0522b

Please sign in to comment.