From e8d667ef70bbd80addcb28decef66228bd70899d Mon Sep 17 00:00:00 2001 From: kassad Date: Mon, 25 Nov 2024 12:42:11 -0800 Subject: [PATCH] Fixed custom domain --- libs/model/src/community/UpdateCustomDomain.command.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/model/src/community/UpdateCustomDomain.command.ts b/libs/model/src/community/UpdateCustomDomain.command.ts index 48e5aaab4f6..e4ae288fc26 100644 --- a/libs/model/src/community/UpdateCustomDomain.command.ts +++ b/libs/model/src/community/UpdateCustomDomain.command.ts @@ -39,7 +39,7 @@ export function UpdateCustomDomain(): Command< } const magicRequestDomain = await fetch( - `https://api.magic.link/v1/api/magic_client/domain/allowlist/add`, + `https://api.magic.link/v2/api/magic_client/domain/allowlist/add`, { method: 'POST', headers: { @@ -55,7 +55,7 @@ export function UpdateCustomDomain(): Command< ); const magicRequestRedirectUrl = await fetch( - `https://api.magic.link/v1/api/magic_client/redirect_url/allowlist/add`, + `https://api.magic.link/v2/api/magic_client/redirect_url/allowlist/add`, { method: 'POST', headers: { @@ -77,14 +77,14 @@ export function UpdateCustomDomain(): Command< magicResponseDomain.status === 'failed' && magicResponseDomain.error_code != 'ALREADY_WHITELISTED_DOMAIN' ) { - throw new AppError(magicResponseDomain); + throw new AppError(magicResponseDomain.message); } if ( magicResponseRedirectUrl.status === 'failed' && magicResponseRedirectUrl.error_code != 'ALREADY_WHITELISTED_DOMAIN' ) { - throw new AppError(magicResponseRedirectUrl); + throw new AppError(magicResponseRedirectUrl.message); } response = await fetch(url, {