refactor: changed auth module to work with signed cookies

This commit is contained in:
Balu Babu
2023-01-30 06:31:10 +05:30
parent 1bbcd638b8
commit a8d50223aa
7 changed files with 10 additions and 8 deletions

View File

@@ -164,12 +164,14 @@ export const authCookieHandler = (
secure: true,
sameSite: 'lax',
maxAge: accessTokenValidity,
signed: true,
});
res.cookie('refresh_token', authTokens.refresh_token, {
httpOnly: true,
secure: true,
sameSite: 'lax',
maxAge: refreshTokenValidity,
signed: true,
});
if (redirect) {
res.status(HttpStatus.OK).redirect(process.env.REDIRECT_URL);