Skip to content

Commit

Permalink
Fixed custom domain
Browse files Browse the repository at this point in the history
  • Loading branch information
kurtisassad authored and ilijabojanovic committed Nov 26, 2024
1 parent 8e45c1f commit e8d667e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libs/model/src/community/UpdateCustomDomain.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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: {
Expand All @@ -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, {
Expand Down

0 comments on commit e8d667e

Please sign in to comment.