Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Implement permission check for client secret generation

Kiran Kaa59c9622773
diff --git a/apps/web/lib/actions/generate-client-secret.ts b/apps/web/lib/actions/generate-client-secret.ts
index 70a8e32c96..48e985f6de 100644
--- a/apps/web/lib/actions/generate-client-secret.ts
+++ b/apps/web/lib/actions/generate-client-secret.ts
@@ -19,6 +19,10 @@ export const generateClientSecret = authActionClient
const { workspace } = ctx;
const { appId } = parsedInput;
+ if (workspace.role !== "owner") {
+ throw new Error("You don't have permission to generate a client secret.");
+ }
+
await prisma.integration.findFirstOrThrow({
where: {
id: appId,