The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
fix dubDomainChecks broken
Steven Teye29ad297b38a
diff --git a/apps/web/lib/api/domains/get-domain-or-throw.ts b/apps/web/lib/api/domains/get-domain-or-throw.tsindex e81255d450..02b99e06bc 100644--- a/apps/web/lib/api/domains/get-domain-or-throw.ts+++ b/apps/web/lib/api/domains/get-domain-or-throw.ts@@ -26,15 +26,13 @@ export const getDomainOrThrow = async ({// if domain is defined:// - it's a dub domain and dubDomainChecks is required, check if the user is part of the dub workspace// - it's a custom domain, check if the domain belongs to the workspace- if (- isDubDomain(domain) &&- dubDomainChecks &&- workspace.id !== DUB_WORKSPACE_ID- ) {- throw new DubApiError({- code: "forbidden",- message: `Domain ${domain} does not belong to workspace ws_${workspace.id}.`,- });+ if (isDubDomain(domain)) {+ if (dubDomainChecks && workspace.id !== DUB_WORKSPACE_ID) {+ throw new DubApiError({+ code: "forbidden",+ message: `Domain ${domain} does not belong to workspace ws_${workspace.id}.`,+ });+ }} else if (domainRecord.projectId !== workspace.id) {throw new DubApiError({code: "forbidden",