diff --git a/src/common/config/index.js b/src/common/config/index.js index 0b9b29e..4fe6c6b 100644 --- a/src/common/config/index.js +++ b/src/common/config/index.js @@ -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, }; @@ -49,7 +49,7 @@ switch (process.env.NODE_ENV) { }; conf.cookieInRefreshTokenOptions = { httpOnly: true, - maxAge: 10 * 60 * 1000, + maxAge: 60 * 60 * 1000, sameSite: 'Lax', }; 1; diff --git a/src/routes/user/user.controller.js b/src/routes/user/user.controller.js index ce0883d..87235cd 100755 --- a/src/routes/user/user.controller.js +++ b/src/routes/user/user.controller.js @@ -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, });