Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

fix: fixed issue with team-invitations and new user accounts (#3137)

Balu Babu84b0c30d64d4
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),
),
),