Skip to content

Commit

Permalink
♻️ 쿠키 옵션 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
jjikky committed Jun 29, 2024
1 parent aecb42d commit e71eb4b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/common/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ switch (process.env.NODE_ENV) {
};
conf.cookieInRefreshTokenOptions = {
httpOnly: true,
maxAge: 10 * 60 * 1000,
maxAge: 60 * 60 * 1000,
sameSite: 'Lax',
secure: true,
};
Expand All @@ -49,7 +49,7 @@ switch (process.env.NODE_ENV) {
};
conf.cookieInRefreshTokenOptions = {
httpOnly: true,
maxAge: 10 * 60 * 1000,
maxAge: 60 * 60 * 1000,
sameSite: 'Lax',
};
1;
Expand Down
4 changes: 2 additions & 2 deletions src/routes/user/user.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ exports.getProfile = (req, res) => {
};

exports.logout = (_, res) => {
res.cookie('accessToken', '', { httpOnly: true, maxAge: 0 });
res.cookie('refreshToken', '', { httpOnly: true, maxAge: 0 });
res.cookie('accessToken', '', { ...config.cookieInAccessTokenOptions, maxAge: 0 });
res.cookie('refreshToken', '', { ...config.cookieInRefreshTokenOptions, maxAge: 0 });
return sendResponse.ok(res, {
message: SucesssMessage.LOGOUT_SUCCESS,
});
Expand Down

0 comments on commit e71eb4b

Please sign in to comment.