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.

improve lead tracking rate limit with workspace-specific key

Kiran K229a2029887c
diff --git a/apps/web/app/api/track/lead/route.ts b/apps/web/app/api/track/lead/route.ts
index 900a179a9d..4ad1e95916 100644
--- a/apps/web/app/api/track/lead/route.ts
+++ b/apps/web/app/api/track/lead/route.ts
@@ -43,7 +43,7 @@ export const POST = withWorkspaceEdge(
// deduplicate lead events – only record 1 event per hour
const { success } = await ratelimit(1, "1 h").limit(
- `recordLead:${customerExternalId}:${eventName.toLowerCase().replace(" ", "-")}`,
+ `recordLead:${workspace.id}:${customerExternalId}:${eventName.toLowerCase().replace(" ", "-")}`,
);
if (!success) {