From e2125b8ce95f4230806f290d1cd36f1562eace1f Mon Sep 17 00:00:00 2001 From: mike Date: Wed, 29 Jul 2015 20:46:37 +0300 Subject: [PATCH] Fix #73 --- build/actions/auth.js | 7 ++++++- lib/actions/auth.coffee | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/build/actions/auth.js b/build/actions/auth.js index f18a3f7d..fdde3b90 100644 --- a/build/actions/auth.js +++ b/build/actions/auth.js @@ -140,7 +140,12 @@ if (username == null) { throw new Error('Username not found'); } - return console.log(username); + return resin.auth.getEmail().then(function(email) { + if (email == null) { + throw new Error('Email not found'); + } + return console.log(("Username: " + username) + '\n' + ("Email: " + email)); + }); }).nodeify(done); } }; diff --git a/lib/actions/auth.coffee b/lib/actions/auth.coffee index 190a1bd4..fba0d100 100644 --- a/lib/actions/auth.coffee +++ b/lib/actions/auth.coffee @@ -177,5 +177,8 @@ exports.whoami = resin.auth.whoami().then (username) -> if not username? throw new Error('Username not found') - console.log(username) + resin.auth.getEmail().then (email) -> + if not email? + throw new Error('Email not found') + console.log "Username: #{username}" + '\n' + "Email: #{email}" .nodeify(done)