From 6304fd50c349ec5ef37339099f70408b58ec098d Mon Sep 17 00:00:00 2001 From: Balu Babu Date: Thu, 15 Jun 2023 17:15:06 +0530 Subject: [PATCH] fix: fixed issue with team-invitations and new user accounts (#3137) --- .../src/team-invitation/team-invite-viewer.guard.ts | 2 +- .../src/team-invitation/team-invitee.guard.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/hoppscotch-backend/src/team-invitation/team-invite-viewer.guard.ts b/packages/hoppscotch-backend/src/team-invitation/team-invite-viewer.guard.ts index a46f5e037..271d3031e 100644 --- a/packages/hoppscotch-backend/src/team-invitation/team-invite-viewer.guard.ts +++ b/packages/hoppscotch-backend/src/team-invitation/team-invite-viewer.guard.ts @@ -32,7 +32,7 @@ export class TeamInviteViewerGuard implements CanActivate { // Get user TE.bindW('user', ({ gqlCtx }) => pipe( - O.fromNullable(gqlCtx.getContext<{ user?: User }>().user), + O.fromNullable(gqlCtx.getContext().req.user), TE.fromOption(() => BUG_AUTH_NO_USER_CTX), ), ), diff --git a/packages/hoppscotch-backend/src/team-invitation/team-invitee.guard.ts b/packages/hoppscotch-backend/src/team-invitation/team-invitee.guard.ts index 577ad595b..1f2bdaa5d 100644 --- a/packages/hoppscotch-backend/src/team-invitation/team-invitee.guard.ts +++ b/packages/hoppscotch-backend/src/team-invitation/team-invitee.guard.ts @@ -33,7 +33,7 @@ export class TeamInviteeGuard implements CanActivate { // Get user TE.bindW('user', ({ gqlCtx }) => pipe( - O.fromNullable(gqlCtx.getContext<{ user?: User }>().user), + O.fromNullable(gqlCtx.getContext().req.user), TE.fromOption(() => BUG_AUTH_NO_USER_CTX), ), ),