Commit 4eee848b by Johannes Zellner

Exit if username or password is empty

1 parent ff4aca50
......@@ -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);
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!