Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia
TypeScript apiapi-clientapi-restapi-testingdeveloper-toolsgraphqlhttphttp-clientpwarestrest-apispatestingtesting-toolstoolsvuevuejswebsocket
hotfix: refresh token cookie migration (HBE-167) (#31)
Balu Babu80c6f600dbe1
diff --git a/packages/hoppscotch-backend/src/auth/strategies/rt-jwt.strategy.ts b/packages/hoppscotch-backend/src/auth/strategies/rt-jwt.strategy.tsindex ae6e96c3c..669fbb170 100644--- a/packages/hoppscotch-backend/src/auth/strategies/rt-jwt.strategy.ts+++ b/packages/hoppscotch-backend/src/auth/strategies/rt-jwt.strategy.ts@@ -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);}diff --git a/packages/hoppscotch-backend/src/decorators/rt-cookie.decorator.ts b/packages/hoppscotch-backend/src/decorators/rt-cookie.decorator.tsindex 97f503f71..a0d12ebbf 100644--- a/packages/hoppscotch-backend/src/decorators/rt-cookie.decorator.ts+++ b/packages/hoppscotch-backend/src/decorators/rt-cookie.decorator.ts@@ -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'];},);