Fixes security vulnerability in workflows (#4376)

This commit is contained in:
Carina Wollendorfer
2022-09-12 09:15:58 +02:00
committed by GitHub
parent a9b79eafb6
commit e6849174c1
@@ -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" });
}