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 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.ts
index 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",