From 1afd956e335dd450a30b6a1afdf610e27fa77b39 Mon Sep 17 00:00:00 2001 From: ameer2468 <33054370+ameer2468@users.noreply.github.com> Date: Fri, 15 Aug 2025 13:36:10 +0300 Subject: [PATCH 1/7] only show A record if subdomain --- .../components/CustomDomainDialog/VerifyStep.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/apps/web/app/(org)/dashboard/settings/organization/components/CustomDomainDialog/VerifyStep.tsx b/apps/web/app/(org)/dashboard/settings/organization/components/CustomDomainDialog/VerifyStep.tsx index 3b0e40df19a..dbdd7a7bf62 100644 --- a/apps/web/app/(org)/dashboard/settings/organization/components/CustomDomainDialog/VerifyStep.tsx +++ b/apps/web/app/(org)/dashboard/settings/organization/components/CustomDomainDialog/VerifyStep.tsx @@ -54,6 +54,14 @@ const VerifyStep = ({ return []; }; + const isSubdomain = (domain: string): boolean => { + domain = domain.replace(/^https?:\/\//, ''); + domain = domain.split('/')[0] ?? ''; + if (!domain) return false; + const parts: string[] = domain.split('.'); + return parts.length > 2; + } + const recommendedAValues = getRecommendedAValues(); // Check if DNS records are already correctly configured @@ -63,8 +71,7 @@ const VerifyStep = ({ const cnameConfigured = recommendedCnames.length > 0 && recommendedCnames.some((rec) => currentCnames.includes(rec.value)); - - const showARecord = recommendedARecord && !aRecordConfigured; + const showARecord = recommendedARecord && !aRecordConfigured && !isSubdomain(domain); const showCNAMERecord = hasRecommendedCNAME && !cnameConfigured; const showTXTRecord = hasTXTVerification && !isVerified; @@ -124,7 +131,7 @@ const VerifyStep = ({ ) : ( !isVerified && domainConfig && ( -