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 rate limit

Steven Teyb7f345f95ac9
diff --git a/apps/web/lib/auth/partner.ts b/apps/web/lib/auth/partner.ts
index 9d1cbb462e..eb1a059886 100644
--- a/apps/web/lib/auth/partner.ts
+++ b/apps/web/lib/auth/partner.ts
@@ -33,10 +33,10 @@ interface WithPartnerProfileOptions {
requiredPermission?: Permission;
}
-export const RATE_LIMIT = {
+const RATE_LIMIT_FOR_PARTNERS = {
api: {
- limit: 15,
- interval: "1 s",
+ limit: 100,
+ interval: "1 m",
},
analyticsApi: {
limit: 6,
@@ -82,7 +82,8 @@ export const withPartnerProfile = (
url.pathname.includes("/analytics") ||
url.pathname.includes("/events");
- const rateLimit = RATE_LIMIT[isAnalytics ? "analyticsApi" : "api"];
+ const rateLimit =
+ RATE_LIMIT_FOR_PARTNERS[isAnalytics ? "analyticsApi" : "api"];
const { success, headers } = await rateLimitRequest({
requests: rateLimit.limit,
diff --git a/apps/web/lib/auth/workspace.ts b/apps/web/lib/auth/workspace.ts
index c0ada60d88..1d346dda1c 100644
--- a/apps/web/lib/auth/workspace.ts
+++ b/apps/web/lib/auth/workspace.ts
@@ -21,7 +21,7 @@ import { rateLimitRequest } from "./rate-limit-request";
import { TokenCacheItem, tokenCache } from "./token-cache";
import { Session, getSession } from "./utils";
-export const RATE_LIMIT_FOR_SESSIONS = {
+const RATE_LIMIT_FOR_SESSIONS = {
api: {
limit: 100,
interval: "1 m",