Skip to content

Commit

Permalink
orgid token
Browse files Browse the repository at this point in the history
  • Loading branch information
sinamics committed Aug 17, 2024
1 parent de8e392 commit e7690e7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/server/api/routers/organizationRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,11 @@ export const organizationRouter = createTRPCRouter({
await ctx.prisma.invitation.deleteMany({
where: {
email: tokenPayload.email,
organizations: tokenPayload.organizationId,
organizations: {
some: {
organizationId: tokenPayload.organizationId,
},
},
},
});

Expand All @@ -966,8 +970,8 @@ export const organizationRouter = createTRPCRouter({
organizationId: tokenPayload.organizationId,
};
}
} catch (_e) {
throw new Error("An error occurred while processing the invitation link.");
} catch (error) {
throw new Error(error.message);
}
// if the user does not exist, return empty object
return {};
Expand Down

0 comments on commit e7690e7

Please sign in to comment.