This commit is contained in:
mike 2015-07-29 20:46:37 +03:00
parent 0bb0e6ea4b
commit e2125b8ce9
2 changed files with 10 additions and 2 deletions

View File

@ -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);
}
};

View File

@ -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)