flatiron-cli-users
Advanced tools
Comparing version 0.1.6 to 0.1.7
@@ -331,14 +331,44 @@ /* | ||
exports.logout = function (callback) { | ||
var app = cliUsers.app; | ||
var app = cliUsers.app, | ||
username = app.config.get('username'); | ||
app.config.clear('username'); | ||
app.config.clear('password'); | ||
async.series([ | ||
// | ||
// Before hook | ||
// | ||
function before (next) { | ||
if (cliUsers.before.logout) { | ||
cliUsers.before.logout({ username: username }, next); | ||
} else { | ||
next(); | ||
} | ||
}, | ||
function logout (next) { | ||
app.config.clear('username'); | ||
app.config.clear('password'); | ||
next(); | ||
}, | ||
// | ||
// After hook | ||
// | ||
function after (next) { | ||
if (cliUsers.after.logout) { | ||
cliUsers.after.logout({ username: username }, next); | ||
} else { | ||
next(); | ||
} | ||
} | ||
], | ||
// | ||
// End workflow | ||
// | ||
function(err, details) { | ||
app.config.save(function (err) { | ||
if (err) { | ||
return callback(err, true); | ||
} | ||
app.config.save(function (err) { | ||
if (err) { | ||
return callback(err, true); | ||
} | ||
app.log.info('User has been logged out'); | ||
callback(); | ||
app.log.info('User has been logged out'); | ||
callback(); | ||
}); | ||
}); | ||
@@ -492,3 +522,3 @@ }; | ||
// | ||
// Usage for `<app> logout`. | ||
// Usage for `<app> whoami`. | ||
// | ||
@@ -495,0 +525,0 @@ exports.whoami.usage = [ |
{ | ||
"name": "flatiron-cli-users", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"description": "Encapsulated commands for managing users in flatiron CLI apps", | ||
@@ -5,0 +5,0 @@ "author": "Nodejitsu Inc. <info@nodejitsu.com>", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29410
841