From 4eee848b4980beddbf5a66d045f2a2ad2fb31c02 Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Thu, 9 Feb 2017 15:48:08 +0100 Subject: Exit if username or password is empty --- cli/actions.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cli') 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) { var username = options.username || readlineSync.question('Username: '); var password = options.password || readlineSync.question('Password: ', { hideEchoBack: true, mask: '' }); + if (!username || !password) process.exit(1); + superagent.post(server + '/api/login').send({ username: username, password: password }).end(function (error, result) { if (error && error.code === 'ENOTFOUND') { console.log('Server %s not found.'.red, server.bold); -- cgit v1.2.3