mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-19 05:37:51 +00:00
Merge pull request #129 from resin-io/issue_#73
Add email address to the returned information, when using whoami(). Fix #73.
This commit is contained in:
commit
b515e427ff
@ -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);
|
||||
}
|
||||
};
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user