|
|
@ -1,12 +1,15 @@ |
|
|
|
import os from 'os'; |
|
|
|
import chalk from 'chalk'; |
|
|
|
import fetch from 'node-fetch'; |
|
|
|
import * as cfg from './cfg'; |
|
|
|
import { stringify as stringifyQuery } from 'querystring'; |
|
|
|
import { validate } from 'email-validator'; |
|
|
|
import readEmail from 'email-prompt'; |
|
|
|
import pkg from '../../package.json'; |
|
|
|
|
|
|
|
async function getVerificationToken (url, email) { |
|
|
|
const data = JSON.stringify({ email }); |
|
|
|
const tokenName = `Now CLI ${os.platform()}-${os.arch()} ${pkg.version} (${os.hostname()})`; |
|
|
|
const data = JSON.stringify({ email, tokenName }); |
|
|
|
const res = await fetch(`${url}/now/registration`, { |
|
|
|
method: 'POST', |
|
|
|
headers: { |
|
|
|