|
|
@ -150,19 +150,13 @@ module.exports = class Alias extends Now { |
|
|
|
if (domainInfo.verified) { |
|
|
|
skipDNSVerification = true |
|
|
|
} else if (domainInfo.uid) { |
|
|
|
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 {verified, created} = await this.setupDomain(domain, {isExternal: true}) |
|
|
|
if (!(created && verified)) { |
|
|
|
const e = new Error(`> Failed to verify the ownership of ${domain}, please refer to 'now domain --help'.`) |
|
|
|
e.userError = true |
|
|
|
throw e |
|
|
|
} |
|
|
|
console.log(`${chalk.cyan('> Success!')} Domain ${chalk.bold(chalk.underline(domain))} verified`) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -227,14 +221,13 @@ module.exports = class Alias extends Now { |
|
|
|
console.log(`> [debug] Trying to register a non-ZeitWorld domain ${domain} for the current user`) |
|
|
|
} |
|
|
|
|
|
|
|
const {uid, verified, verifyToken, created} = await this.setupDomain(domain, {isExternal: true}) |
|
|
|
if (created && verified) { |
|
|
|
console.log(`${chalk.cyan('> Success!')} Domain ${chalk.bold(chalk.underline(domain))} ${chalk.dim(`(${uid})`)} added`) |
|
|
|
} else if (verifyToken) { |
|
|
|
const e = new Error(`> Verification required: Please add the following TXT record on the external DNS server: _now.${domain}: ${verifyToken}`) |
|
|
|
const {uid, verified, created} = await this.setupDomain(domain, {isExternal: true}) |
|
|
|
if (!(created && verified)) { |
|
|
|
const e = new Error(`> Failed to verify the ownership of ${domain}, please refer to 'now domain --help'.`) |
|
|
|
e.userError = true |
|
|
|
throw e |
|
|
|
} |
|
|
|
console.log(`${chalk.cyan('> Success!')} Domain ${chalk.bold(chalk.underline(domain))} ${chalk.dim(`(${uid})`)} added`) |
|
|
|
} |
|
|
|
|
|
|
|
console.log(`> Verification ${chalk.bold('OK')}!`) |
|
|
|