Fixes security vulnerability in workflows (#4376)
This commit is contained in:
@@ -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" });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user