Skip to content

Commit

Permalink
[minor] added a login command
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoreed committed Jul 11, 2011
1 parent 082d80a commit 702a03e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/jitsu.js
Expand Up @@ -50,6 +50,7 @@ jitsu.commands.alias('create', { resource: 'apps', command: 'create' });
jitsu.commands.alias('deploy', { resource: 'apps', command: 'deploy' });
jitsu.commands.alias('list', { resource: 'apps', command: 'list' });
jitsu.commands.alias('conf', { resource: 'config', command: 'list' });
jitsu.commands.alias('login', { resource: 'users', command: 'login' });
jitsu.commands.alias('logout', { resource: 'users', command: 'logout' });
jitsu.commands.alias('signup', { resource: 'users', command: 'create' });

Expand Down Expand Up @@ -195,7 +196,16 @@ jitsu.auth = function (callback) {
//
jitsu.setupUser = function (callback) {
winston.warn('No user has been setup on this machine');
jitsu.setupUserNoWarn(callback);
};

//
// ### function setupUserNoWarn (callback)
// #### @callback {function} Continuation to pass control to when complete.
// Prompts the user for their username / password combo, then sets up the jitsu CLI,
// and saves the resulting configuration to disk without a warning
//
jitsu.setupUserNoWarn = function(callback) {
//
// Attempt to get the password three times.
//
Expand Down
4 changes: 4 additions & 0 deletions lib/jitsu/commands/users.js
Expand Up @@ -223,3 +223,7 @@ users.forgot.usage = [
'',
'jitsu users forgot <username>'
];

users.login = function(callback) {
jitsu.setupUserNoWarn(callback);
}

0 comments on commit 702a03e

Please sign in to comment.