From 2eb172171f7efd2ea35d08ab4846cd46be031bb5 Mon Sep 17 00:00:00 2001 From: nkzawa Date: Fri, 3 Jun 2016 01:15:49 +0900 Subject: [PATCH 1/2] login: post tokenName --- lib/login.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/login.js b/lib/login.js index d48f240..4500d45 100644 --- a/lib/login.js +++ b/lib/login.js @@ -1,3 +1,4 @@ +import os from 'os'; import chalk from 'chalk'; import fetch from 'node-fetch'; import * as cfg from './cfg'; @@ -6,7 +7,8 @@ import { validate } from 'email-validator'; import readEmail from 'email-prompt'; async function getVerificationToken (url, email) { - const data = JSON.stringify({ email }); + const tokenName = `Now CLI (${os.hostname()})`; + const data = JSON.stringify({ email, tokenName }); const res = await fetch(`${url}/now/registration`, { method: 'POST', headers: { From 08c860af418e192247938301e43c8680cebd1c43 Mon Sep 17 00:00:00 2001 From: nkzawa Date: Mon, 6 Jun 2016 11:58:36 +0900 Subject: [PATCH 2/2] fix tokenName --- lib/login.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/login.js b/lib/login.js index 4500d45..ce7db19 100644 --- a/lib/login.js +++ b/lib/login.js @@ -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',