diff --git a/build/actions/auth.js b/build/actions/auth.js index f18a3f7d..15c3eaf8 100644 --- a/build/actions/auth.js +++ b/build/actions/auth.js @@ -1,5 +1,5 @@ (function() { - var TOKEN_URL, _, async, form, open, resin, settings, url; + var TOKEN_URL, _, async, form, open, resin, settings, url, visuals; open = require('open'); @@ -15,6 +15,8 @@ form = require('resin-cli-form'); + visuals = require('resin-cli-visuals'); + TOKEN_URL = url.resolve(settings.get('dashboardUrl'), '/preferences'); exports.login = { @@ -140,7 +142,12 @@ if (username == null) { throw new Error('Username not found'); } - return console.log(username); + return resin.auth.getEmail().then(function(email) { + return console.log(visuals.table.vertical({ + username: username, + email: email + }, ['$account information$', 'username', 'email'])); + }); }).nodeify(done); } }; diff --git a/lib/actions/auth.coffee b/lib/actions/auth.coffee index 190a1bd4..dc82f3cf 100644 --- a/lib/actions/auth.coffee +++ b/lib/actions/auth.coffee @@ -5,6 +5,7 @@ async = require('async') resin = require('resin-sdk') settings = require('resin-settings-client') form = require('resin-cli-form') +visuals = require('resin-cli-visuals') TOKEN_URL = url.resolve(settings.get('dashboardUrl'), '/preferences') @@ -177,5 +178,10 @@ exports.whoami = resin.auth.whoami().then (username) -> if not username? throw new Error('Username not found') - console.log(username) + resin.auth.getEmail().then (email) -> + console.log visuals.table.vertical { username, email }, [ + '$account information$' + 'username' + 'email' + ] .nodeify(done)