hotfix: refresh token cookie migration (HBE-167) (#31)

* chore: removed signed cookies from refresh token strategy

* chore: removed signed cookies from refresh RTCookie decorator
This commit is contained in:
Balu Babu
2023-03-03 15:52:26 +05:30
committed by GitHub
parent a938be3712
commit 80c6f600db
2 changed files with 2 additions and 2 deletions

View File

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

View File

@@ -7,6 +7,6 @@ import { GqlExecutionContext } from '@nestjs/graphql';
export const RTCookie = createParamDecorator(
(data: unknown, context: ExecutionContext) => {
const ctx = GqlExecutionContext.create(context);
return ctx.getContext().req.signedCookies['refresh_token'];
return ctx.getContext().req.cookies['refresh_token'];
},
);