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

@@ -22,7 +22,7 @@ export class JwtStrategy extends PassportStrategy(Strategy, 'jwt') {
super({
jwtFromRequest: ExtractJwt.fromExtractors([
(request: Request) => {
const ATCookie = request.cookies['access_token'];
const ATCookie = request.signedCookies['access_token'];
if (!ATCookie) {
throw new ForbiddenException(COOKIES_NOT_FOUND);
}

View File

@@ -21,7 +21,7 @@ export class RTJwtStrategy extends PassportStrategy(Strategy, 'jwt-refresh') {
super({
jwtFromRequest: ExtractJwt.fromExtractors([
(request: Request) => {
const RTCookie = request.cookies['refresh_token'];
const RTCookie = request.signedCookies['refresh_token'];
if (!RTCookie) {
throw new ForbiddenException(COOKIES_NOT_FOUND);
}