|
|
@ -5,9 +5,10 @@ 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 tokenName = `Now CLI (${os.hostname()})`; |
|
|
|
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', |
|
|
|