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.

Restore custom rate limit messages on migrated policies

Cursor Agentac75e04492c5
diff --git a/apps/web/lib/upstash/ratelimit-policies.ts b/apps/web/lib/upstash/ratelimit-policies.ts
index 6a37300db5..c7b824aef2 100644
--- a/apps/web/lib/upstash/ratelimit-policies.ts
+++ b/apps/web/lib/upstash/ratelimit-policies.ts
@@ -114,12 +114,16 @@ export const RATELIMIT_POLICIES = {
attempts: 1,
window: "1 m",
keyPrefix: "rl:oauth:app:review:submit",
+ message:
+ "Rate limit exceeded. Please try again later or contact support.",
},
verifyWorkspaceSetup: {
attempts: 5,
window: "1 m",
keyPrefix: "rl:workspace:setup:verify",
+ message:
+ "Too many verification attempts. Please try again in a minute.",
},
createProgramApplication: {
@@ -133,12 +137,15 @@ export const RATELIMIT_POLICIES = {
attempts: 5,
window: "1 h",
keyPrefix: "rl:partner:social:verification",
+ message: "Too many verification attempts. Please try again later.",
},
partnerUsernameUpdate: {
attempts: 5,
window: "1 h",
keyPrefix: "rl:partner:profile:username-update",
+ message:
+ "You've updated your username too many times. Please try again later.",
},
domainTransfer: {
@@ -151,17 +158,22 @@ export const RATELIMIT_POLICIES = {
attempts: 1,
window: "30 s",
keyPrefix: "rl:analytics:export",
+ message:
+ "Analytics export is limited to once every 30 seconds. Please try again shortly.",
},
retryFailedPaypalPayout: {
attempts: 1,
window: "12 h",
keyPrefix: "rl:partner:paypal:retry-failed-payout",
+ message:
+ "You've reached the maximum number of retry attempts for the past 24 hours. Please wait and try again later.",
},
identityVerificationStart: {
attempts: 1,
window: "1 h",
keyPrefix: "rl:partner:identity:verification:start",
+ message: "Too many verification attempts. Please try again later.",
},
} as const satisfies Record<string, RatelimitPolicy>;