|
|
@ -150,9 +150,19 @@ module.exports = class Alias extends Now { |
|
|
|
if (domainInfo.verified) { |
|
|
|
skipDNSVerification = true |
|
|
|
} else if (domainInfo.uid) { |
|
|
|
const e = new Error(`> The domain ${domain} is already registered with now but additional verification is needed, please refer to 'now domain --help'.`) |
|
|
|
e.userError = true |
|
|
|
throw e |
|
|
|
const {verified, verifyToken, created} = await this.setupDomain(domain, {isExternal: true}) |
|
|
|
|
|
|
|
if (created && verified) { |
|
|
|
console.log(`${chalk.cyan('> Success!')} Domain ${chalk.bold(chalk.underline(domain))} verified`) |
|
|
|
} else if (verifyToken) { |
|
|
|
const e = new Error(`> Verification required: Please add the following TXT record on the external DNS server: _now.${domain}: ${verifyToken}`) |
|
|
|
e.userError = true |
|
|
|
throw e |
|
|
|
} else { |
|
|
|
const e = new Error(`> Failed to verify the ownership of ${domain}, please refer to 'now domain --help'.`) |
|
|
|
e.userError = true |
|
|
|
throw e |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|