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.

Fix OAuth app route creation

Kiran K5d175df9a66d
diff --git a/apps/web/app/api/oauth/apps/route.ts b/apps/web/app/api/oauth/apps/route.ts
index eb176b3951..f338ce0c6c 100644
--- a/apps/web/app/api/oauth/apps/route.ts
+++ b/apps/web/app/api/oauth/apps/route.ts
@@ -112,20 +112,7 @@ export const POST = withWorkspace(
},
},
},
- select: {
- id: true,
- createdAt: true,
- updatedAt: true,
- name: true,
- slug: true,
- description: true,
- developer: true,
- logo: true,
- website: true,
- installUrl: true,
- readme: true,
- screenshots: true,
- verified: true,
+ include: {
oAuthApp: true,
},
});
diff --git a/apps/web/lib/zod/schemas/oauth.ts b/apps/web/lib/zod/schemas/oauth.ts
index 5f03520bbb..46251cc7ce 100644
--- a/apps/web/lib/zod/schemas/oauth.ts
+++ b/apps/web/lib/zod/schemas/oauth.ts
@@ -22,6 +22,7 @@ export const createOAuthAppSchema = createIntegrationSchema.merge(
.max(5, {
message: "only 5 redirect URIs are allowed",
})
+ .transform((urls) => urls.filter((url) => url.trim().length > 0))
.refine(
(urls) => {
return urls.every((url) => /^(https?:\/\/)/i.test(url));