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.

Restrict `.dub.link` usage to Business+ plan (Dub Partners)

Steven Tey13c772b4e076
diff --git a/apps/web/lib/api/links/plan-features-check.ts b/apps/web/lib/api/links/plan-features-check.ts
index eb13ac6a8e..fb1fbe7bf4 100644
--- a/apps/web/lib/api/links/plan-features-check.ts
+++ b/apps/web/lib/api/links/plan-features-check.ts
@@ -47,7 +47,13 @@ export const proFeaturesCheck = (payload: NewLinkProps) => {
};
export const businessFeaturesCheck = (payload: NewLinkProps) => {
- const { testVariants, trackConversion } = payload;
+ const { domain, testVariants, trackConversion } = payload;
+
+ if (domain && domain.endsWith(".dub.link")) {
+ throw new Error(
+ "You can only use .dub.link domains on a Business plan and above. Upgrade to Business to use this domain.",
+ );
+ }
if (testVariants || trackConversion) {
const businessFeaturesString = combineWords(