Fixes security vulnerability in workflows (#4376)
This commit is contained in:
1 parent
a9b79eafb6
commit
e6849174c1
1 file changed
+1
-4
@@ -287,13 +287,10 @@ export const workflowsRouter = createProtectedRouter()
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (
|
if (
|
||||||
newEventType &&
|
newEventType &&
|
||||||
newEventType.userId !== user.id &&
|
newEventType.userId !== user.id &&
|
||||||
newEventType?.team?.members.filter((membership) => {
|
newEventType?.team?.members.filter((membership) => membership.userId === user.id).length === 0
|
||||||
membership.userId === user.id;
|
|
||||||
}).length
|
|
||||||
) {
|
) {
|
||||||
throw new TRPCError({ code: "UNAUTHORIZED" });
|
throw new TRPCError({ code: "UNAUTHORIZED" });
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user