From 38302e39af1f9ea6ec35cc4da833d141801eae29 Mon Sep 17 00:00:00 2001 From: Haris Chaniotakis Date: Fri, 11 Aug 2023 14:49:12 +0300 Subject: [PATCH] feat(clerk-js): Implement resend OTP functionality for Organization Domain This commit implements the Resend OTP functionality on the Organization Domain page, that tries to send again the email that contains the OTP code in order to complete the verification flow --- .changeset/pink-keys-shake.md | 5 +++++ .../ui/components/OrganizationProfile/VerifyDomainPage.tsx | 3 +++ 2 files changed, 8 insertions(+) create mode 100644 .changeset/pink-keys-shake.md diff --git a/.changeset/pink-keys-shake.md b/.changeset/pink-keys-shake.md new file mode 100644 index 00000000000..ef3dd7fc4d1 --- /dev/null +++ b/.changeset/pink-keys-shake.md @@ -0,0 +1,5 @@ +--- +'@clerk/clerk-js': minor +--- + +Implement Resend OTP functionality as part of the Organization Domain verification flow diff --git a/packages/clerk-js/src/ui/components/OrganizationProfile/VerifyDomainPage.tsx b/packages/clerk-js/src/ui/components/OrganizationProfile/VerifyDomainPage.tsx index 952c34eed70..4eb4d3184a1 100644 --- a/packages/clerk-js/src/ui/components/OrganizationProfile/VerifyDomainPage.tsx +++ b/packages/clerk-js/src/ui/components/OrganizationProfile/VerifyDomainPage.tsx @@ -84,6 +84,9 @@ export const VerifyDomainPage = withCardStateProvider(() => { } const handleResend = () => { codeControl.reset(); + domain?.prepareAffiliationVerification({ affiliationEmailAddress: emailField.value }).catch(err => { + handleError(err, [emailField], card.setError); + }); }; const dataChanged = organization.name !== emailField.value;