Skip to content

Commit

Permalink
feat: setCookie sameSite:none으로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
syoung125 committed Sep 4, 2023
1 parent b89f92b commit 747f1e3
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 15 deletions.
7 changes: 0 additions & 7 deletions src/pages/api/redirect/apple.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,6 @@ export default async function handler(
console.log('accessToken', accessToken);
console.log('refreshToken', refreshToken);

if (refreshToken) {
res.setHeader(
'Set-Cookie',
`${REFRESH_TOKEN_KEY}=${refreshToken}; path=/; samesite=none; httponly; Secure`
);
}

console.log('res.getHeaders', res.getHeaders());

res.redirect(307, '/');
Expand Down
7 changes: 0 additions & 7 deletions src/pages/api/redirect/kakao.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,6 @@ export default async function handler(
setAccessToken(accessToken);
setRefreshToken(refreshToken, { req, res });

if (refreshToken) {
res.setHeader(
'Set-Cookie',
`${REFRESH_TOKEN_KEY}=${refreshToken}; path=/; samesite=lax; httponly;`
);
}

res.redirect(307, '/');
} catch (err) {
console.error(err);
Expand Down
2 changes: 1 addition & 1 deletion src/shared/utils/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const setRefreshToken = (
httpOnly: true,
secure: process.env.NODE_ENV !== 'development',
maxAge: FOURTEEN_DAYS,
sameSite: 'strict',
sameSite: 'none',
path: '/',
});
};
Expand Down

0 comments on commit 747f1e3

Please sign in to comment.