Commit 7712c94e by Johannes Zellner

Fix uri parsing

1 parent 14fd08ba
Showing with 5 additions and 5 deletions
...@@ -55,14 +55,14 @@ function collectFiles(filesOrFolders, options) { ...@@ -55,14 +55,14 @@ function collectFiles(filesOrFolders, options) {
function login(uri) { function login(uri) {
var tmp = url.parse(uri); var tmp = url.parse(uri);
if (!tmp.host) tmp = url.parse('https://' + uri); if (!tmp.slashes) tmp = url.parse('https://' + uri);
var server = tmp.protocol + '//' + tmp.host; var server = tmp.protocol + '//' + tmp.host;
console.log('Using server', server.bold); console.log('Using server', server.cyan);
var username = readlineSync.question('Username: ', { hideEchoBack: false }); var username = readlineSync.question('Username: ');
var password = readlineSync.question('Password: ', { hideEchoBack: true }); var password = readlineSync.question('Password: ', { noEchoBack: true });
superagent.get(server + API + '/').query({ username: username, password: password }).end(function (error, result) { superagent.get(server + API + '/').query({ username: username, password: password }).end(function (error, result) {
if (error && error.code === 'ENOTFOUND') { if (error && error.code === 'ENOTFOUND') {
...@@ -86,7 +86,7 @@ function login(uri) { ...@@ -86,7 +86,7 @@ function login(uri) {
gQuery = { username: username, password: password }; gQuery = { username: username, password: password };
console.log('Ok'.green); console.log('Login successful'.green);
}); });
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!