Skip to content

Commit

Permalink
Fixes security vulnerability in workflows (#4376)
Browse files Browse the repository at this point in the history
  • Loading branch information
CarinaWolli authored and joeauyeung committed Sep 13, 2022
1 parent 9fddd03 commit ca74653
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions packages/trpc/server/routers/viewer/workflows.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -287,13 +287,10 @@ export const workflowsRouter = createProtectedRouter()
},
},
});

if (
newEventType &&
newEventType.userId !== user.id &&
newEventType?.team?.members.filter((membership) => {
membership.userId === user.id;
}).length
newEventType?.team?.members.filter((membership) => membership.userId === user.id).length === 0
) {
throw new TRPCError({ code: "UNAUTHORIZED" });
}
Expand Down

0 comments on commit ca74653

Please sign in to comment.