Skip to content

Commit

Permalink
Merge pull request #52 from Murakano/dev
Browse files Browse the repository at this point in the history
♻️삭제쿠키 옵션 추가
  • Loading branch information
jjikky authored Jul 10, 2024
2 parents 7692bb6 + fee34e9 commit 3dfb7df
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion src/common/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ switch (process.env.NODE_ENV) {
domain: '.murakano.site',
secure: true,
};
conf.cookieInRefreshTokenDeleteOptions = {
httpOnly: true,
maxAge: 0,
sameSite: 'Lax',
domain: '.murakano.site',
secure: true,
};
conf.envMode = 'prod';
break;
case 'development':
Expand All @@ -54,7 +61,11 @@ switch (process.env.NODE_ENV) {
maxAge: 12 * 60 * 60 * 1000,
sameSite: 'Lax',
};
1;
conf.cookieInRefreshTokenDeleteOptions = {
httpOnly: true,
maxAge: 0,
sameSite: 'Lax',
};
conf.envMode = 'dev';
break;
default:
Expand Down
2 changes: 1 addition & 1 deletion src/routes/user/user.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ exports.getProfile = (req, res) => {
};

exports.logout = (_, res) => {
res.clearCookie('refreshToken', config.cookieInRefreshTokenOptions);
res.clearCookie('refreshToken', config.cookieInRefreshTokenDeleteOptions);
return sendResponse.ok(res, {
message: SuccessMessage.LOGOUT_SUCCESS,
});
Expand Down

0 comments on commit 3dfb7df

Please sign in to comment.