From e9846d2581f0b76c1c3eb4a35d536ac009cfcb25 Mon Sep 17 00:00:00 2001
From: ameer2468 <33054370+ameer2468@users.noreply.github.com>
Date: Tue, 12 Aug 2025 16:45:23 +0300
Subject: [PATCH 1/8] console logs
---
.../components/CustomDomainDialog/VerifyStep.tsx | 6 ++++++
1 file changed, 6 insertions(+)
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 312340b3519..a2b3451f6fd 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
@@ -91,6 +91,12 @@ const VerifyStep = ({
};
}, [activeOrganization?.organization.customDomain, isVerified]);
+ console.log({
+ customDomain: activeOrganization?.organization.customDomain,
+ isVerified,
+ domainConfig,
+ })
+
return (
From 57acc1961662f8aedb938ec2f4a62f8c797d2237 Mon Sep 17 00:00:00 2001
From: ameer2468 <33054370+ameer2468@users.noreply.github.com>
Date: Tue, 12 Aug 2025 17:03:05 +0300
Subject: [PATCH 2/8] handle txt
---
.../CustomDomainDialog/VerifyStep.tsx | 83 ++++++++++++++++++-
1 file changed, 82 insertions(+), 1 deletion(-)
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 a2b3451f6fd..ef9bc632ef2 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
@@ -31,8 +31,10 @@ const VerifyStep = ({
const recommendedARecord = domainConfig?.requiredAValue;
const currentCnames = domainConfig?.cnames || [];
const currentAValues = domainConfig?.currentAValues || [];
+ const verificationRecords = domainConfig?.verification || [];
const hasRecommendedCNAME = recommendedCnames.length > 0;
+ const hasTXTVerification = verificationRecords.length > 0;
const getRecommendedAValues = () => {
if (recommendedARecord) return [recommendedARecord];
@@ -64,6 +66,7 @@ const VerifyStep = ({
const showARecord = recommendedARecord && !aRecordConfigured;
const showCNAMERecord = hasRecommendedCNAME && !cnameConfigured;
+ const showTXTRecord = hasTXTVerification && !isVerified;
const handleCopy = async (text: string, fieldId: string) => {
try {
@@ -95,7 +98,7 @@ const VerifyStep = ({
customDomain: activeOrganization?.organization.customDomain,
isVerified,
domainConfig,
- })
+ });
return (
@@ -118,6 +121,84 @@ const VerifyStep = ({
!isVerified &&
domainConfig && (
+ {/* TXT Record Configuration for Verification */}
+ {showTXTRecord && (
+
+
+
+ TXT Record Configuration
+
+
+ Add this TXT record to verify domain ownership:
+
+
+
+
+ {verificationRecords.map((record, index) => (
+
+
+
-
+ Type
+
+ -
+ {record.type || "TXT"}
+
+
+
+
-
+ Name
+
+ -
+
+ {record.domain?.replace(`.${domain}`, '') || "@"}
+
+
+
+
+
-
+ Value
+
+
-
+
+
+ {record.value}
+
+
+
+
+
+ {record.reason && (
+
+
-
+ Purpose
+
+ -
+ {record.reason === "pending_domain_verification"
+ ? "Domain verification"
+ : record.reason}
+
+
+ )}
+
+ ))}
+
+
+
+ )}
+
{/* A Record Configuration */}
{showARecord && (
From 5bf00930e1168dd91267e3dc446abb8ef7ec91de Mon Sep 17 00:00:00 2001
From: ameer2468 <33054370+ameer2468@users.noreply.github.com>
Date: Tue, 12 Aug 2025 17:12:13 +0300
Subject: [PATCH 3/8] Update VerifyStep.tsx
---
.../components/CustomDomainDialog/VerifyStep.tsx | 16 +++-------------
1 file changed, 3 insertions(+), 13 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 ef9bc632ef2..f814fda9174 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
@@ -150,7 +150,9 @@ const VerifyStep = ({
- {record.domain?.replace(`.${domain}`, '') || "@"}
+ {record.domain?.startsWith('_')
+ ? record.domain.replace(`.${domain}`, '')
+ : record.domain?.replace(`.${domain}`, '') || "@"}
@@ -180,18 +182,6 @@ const VerifyStep = ({
- {record.reason && (
-
-
- Purpose
-
-
- {record.reason === "pending_domain_verification"
- ? "Domain verification"
- : record.reason}
-
-
- )}
))}
From b92eb4f51be717d3c4ffff7fd8585c50f4340861 Mon Sep 17 00:00:00 2001
From: ameer2468 <33054370+ameer2468@users.noreply.github.com>
Date: Tue, 12 Aug 2025 17:15:17 +0300
Subject: [PATCH 4/8] Update CustomDomain.tsx
---
.../settings/organization/components/CustomDomain.tsx | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/apps/web/app/(org)/dashboard/settings/organization/components/CustomDomain.tsx b/apps/web/app/(org)/dashboard/settings/organization/components/CustomDomain.tsx
index f895c8a0068..b5d2862c47f 100644
--- a/apps/web/app/(org)/dashboard/settings/organization/components/CustomDomain.tsx
+++ b/apps/web/app/(org)/dashboard/settings/organization/components/CustomDomain.tsx
@@ -95,7 +95,7 @@ export function CustomDomain() {
className="text-red-200 size-3"
icon={faExclamationCircle}
/>
-
+
Custom domains are not available in development mode
@@ -145,8 +145,8 @@ export function CustomDomain() {
type="submit"
size="sm"
className="min-w-fit"
- spinner={removeDomainMutation.isPending}
- disabled={removeDomainMutation.isPending}
+ spinner={isVerified ? removeDomainMutation.isPending : undefined}
+ disabled={isVerified ? removeDomainMutation.isPending : undefined}
variant="dark"
onClick={async (e) => {
e.preventDefault();
From e4a67843f2e957404721ddc5e348ddcaea4b7b19 Mon Sep 17 00:00:00 2001
From: ameer2468 <33054370+ameer2468@users.noreply.github.com>
Date: Tue, 12 Aug 2025 17:45:26 +0300
Subject: [PATCH 5/8] Update VerifyStep.tsx
---
.../components/CustomDomainDialog/VerifyStep.tsx | 6 ------
1 file changed, 6 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 f814fda9174..47273905e9e 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
@@ -94,12 +94,6 @@ const VerifyStep = ({
};
}, [activeOrganization?.organization.customDomain, isVerified]);
- console.log({
- customDomain: activeOrganization?.organization.customDomain,
- isVerified,
- domainConfig,
- });
-
return (
From 7f1de729864b5581350d32f23881cb66581debbe Mon Sep 17 00:00:00 2001
From: ameer2468 <33054370+ameer2468@users.noreply.github.com>
Date: Tue, 12 Aug 2025 18:30:35 +0300
Subject: [PATCH 6/8] Update VerifyStep.tsx
---
.../components/CustomDomainDialog/VerifyStep.tsx | 12 +++++++++---
1 file changed, 9 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 47273905e9e..309683c5e9a 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
@@ -144,9 +144,15 @@ const VerifyStep = ({
- {record.domain?.startsWith('_')
- ? record.domain.replace(`.${domain}`, '')
- : record.domain?.replace(`.${domain}`, '') || "@"}
+ {(() => {
+ if (!record.domain) return "@";
+ if (record.domain === domain) return "@";
+ const suffix = `.${domain}`;
+ if (record.domain.endsWith(suffix)) {
+ return record.domain.replace(suffix, '') || "@";
+ }
+ return record.domain;
+ })()}
From 961f7bd3f0444bdafc4ee8f291956993dd968693 Mon Sep 17 00:00:00 2001
From: ameer2468 <33054370+ameer2468@users.noreply.github.com>
Date: Tue, 12 Aug 2025 18:33:09 +0300
Subject: [PATCH 7/8] cleanup
---
.../CustomDomainDialog/VerifyStep.tsx | 22 ++++++++++---------
1 file changed, 12 insertions(+), 10 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 309683c5e9a..a798a7e8cdb 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
@@ -4,7 +4,7 @@ import { Check, Copy } from "lucide-react";
import { useEffect, useState } from "react";
import { toast } from "sonner";
import { useDashboardContext } from "@/app/(org)/dashboard/Contexts";
-import type { DomainConfig } from "./types";
+import type { DomainConfig, DomainVerification } from "./types";
interface VerifyStepProps {
domain: string;
@@ -94,6 +94,16 @@ const VerifyStep = ({
};
}, [activeOrganization?.organization.customDomain, isVerified]);
+ const TXTDomainValueHandler = (record: DomainVerification) => {
+ if (!record.domain) return "@";
+ if (record.domain === domain) return "@";
+ const suffix = `.${domain}`;
+ if (record.domain.endsWith(suffix)) {
+ return record.domain.replace(suffix, '') || "@";
+ }
+ return record.domain;
+ }
+
return (
@@ -144,15 +154,7 @@ const VerifyStep = ({
- {(() => {
- if (!record.domain) return "@";
- if (record.domain === domain) return "@";
- const suffix = `.${domain}`;
- if (record.domain.endsWith(suffix)) {
- return record.domain.replace(suffix, '') || "@";
- }
- return record.domain;
- })()}
+ {TXTDomainValueHandler(record)}
From e9e4c892fa884de6f3e2bd83fe51f78b108b77ab Mon Sep 17 00:00:00 2001
From: ameer2468 <33054370+ameer2468@users.noreply.github.com>
Date: Tue, 12 Aug 2025 18:46:56 +0300
Subject: [PATCH 8/8] Update VerifyStep.tsx
---
.../CustomDomainDialog/VerifyStep.tsx | 21 +++++++++++--------
1 file changed, 12 insertions(+), 9 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 a798a7e8cdb..3b0e40df19a 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
@@ -74,7 +74,7 @@ const VerifyStep = ({
setCopiedField(fieldId);
setTimeout(() => setCopiedField(null), 2000);
toast.success("Copied to clipboard");
- } catch (err) {
+ } catch {
toast.error("Failed to copy to clipboard");
}
};
@@ -99,10 +99,10 @@ const VerifyStep = ({
if (record.domain === domain) return "@";
const suffix = `.${domain}`;
if (record.domain.endsWith(suffix)) {
- return record.domain.replace(suffix, '') || "@";
+ return record.domain.replace(suffix, "") || "@";
}
return record.domain;
- }
+ };
return (
@@ -139,7 +139,7 @@ const VerifyStep = ({
{verificationRecords.map((record, index) => (
-
+
-
Type
@@ -154,7 +154,7 @@ const VerifyStep = ({
-
- {TXTDomainValueHandler(record)}
+ {TXTDomainValueHandler(record)}
@@ -170,7 +170,10 @@ const VerifyStep = ({