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.

chore: Add createdBy field to OAuth app creation

Kiran Kc3e9222ad8ab
diff --git a/apps/web/app/api/oauth-apps/route.ts b/apps/web/app/api/oauth-apps/route.ts
index 594c7f9192..24fd63db77 100644
--- a/apps/web/app/api/oauth-apps/route.ts
+++ b/apps/web/app/api/oauth-apps/route.ts
@@ -16,7 +16,7 @@ import { z } from "zod";
// POST /api/oauth-apps - create a new OAuth apps
export const POST = withWorkspace(
- async ({ req, workspace }) => {
+ async ({ req, workspace, session }) => {
const { name, developer, website, redirectUri, scopes } =
createOAuthClientSchema.parse(await parseRequestBody(req));
@@ -32,6 +32,7 @@ export const POST = withWorkspace(
scopes: [...new Set(scopes)].join(" "),
clientId: nanoid(OAUTH_CLIENT_ID_LENGTH),
clientSecretHashed: await hashToken(clientSecret),
+ createdBy: session.user.id,
},
});