diff options
-rw-r--r-- | cli/actions.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/cli/actions.js b/cli/actions.js index e9bbd9d..2440c2d 100644 --- a/cli/actions.js +++ b/cli/actions.js | |||
@@ -66,6 +66,8 @@ function login(uri, options) { | |||
66 | var username = options.username || readlineSync.question('Username: '); | 66 | var username = options.username || readlineSync.question('Username: '); |
67 | var password = options.password || readlineSync.question('Password: ', { hideEchoBack: true, mask: '' }); | 67 | var password = options.password || readlineSync.question('Password: ', { hideEchoBack: true, mask: '' }); |
68 | 68 | ||
69 | if (!username || !password) process.exit(1); | ||
70 | |||
69 | superagent.post(server + '/api/login').send({ username: username, password: password }).end(function (error, result) { | 71 | superagent.post(server + '/api/login').send({ username: username, password: password }).end(function (error, result) { |
70 | if (error && error.code === 'ENOTFOUND') { | 72 | if (error && error.code === 'ENOTFOUND') { |
71 | console.log('Server %s not found.'.red, server.bold); | 73 | console.log('Server %s not found.'.red, server.bold); |