diff options
author | Johannes Zellner <johannes@nebulon.de> | 2016-03-01 12:18:26 +0100 |
---|---|---|
committer | Johannes Zellner <johannes@nebulon.de> | 2016-03-01 12:18:26 +0100 |
commit | 7712c94e9882964a485cf57774b6effe09f99049 (patch) | |
tree | c1219aac2ac64a21d1476d16ce110cff2e93a3f9 | |
parent | 14fd08ba1324d574027c5ac6d48d65c572e7cf4c (diff) | |
download | Surfer-7712c94e9882964a485cf57774b6effe09f99049.tar.gz Surfer-7712c94e9882964a485cf57774b6effe09f99049.tar.zst Surfer-7712c94e9882964a485cf57774b6effe09f99049.zip |
Fix uri parsing
-rw-r--r-- | cli/actions.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/cli/actions.js b/cli/actions.js index ab982a7..6c4631c 100644 --- a/cli/actions.js +++ b/cli/actions.js | |||
@@ -55,14 +55,14 @@ function collectFiles(filesOrFolders, options) { | |||
55 | 55 | ||
56 | function login(uri) { | 56 | function login(uri) { |
57 | var tmp = url.parse(uri); | 57 | var tmp = url.parse(uri); |
58 | if (!tmp.host) tmp = url.parse('https://' + uri); | 58 | if (!tmp.slashes) tmp = url.parse('https://' + uri); |
59 | 59 | ||
60 | var server = tmp.protocol + '//' + tmp.host; | 60 | var server = tmp.protocol + '//' + tmp.host; |
61 | 61 | ||
62 | console.log('Using server', server.bold); | 62 | console.log('Using server', server.cyan); |
63 | 63 | ||
64 | var username = readlineSync.question('Username: ', { hideEchoBack: false }); | 64 | var username = readlineSync.question('Username: '); |
65 | var password = readlineSync.question('Password: ', { hideEchoBack: true }); | 65 | var password = readlineSync.question('Password: ', { noEchoBack: true }); |
66 | 66 | ||
67 | superagent.get(server + API + '/').query({ username: username, password: password }).end(function (error, result) { | 67 | superagent.get(server + API + '/').query({ username: username, password: password }).end(function (error, result) { |
68 | if (error && error.code === 'ENOTFOUND') { | 68 | if (error && error.code === 'ENOTFOUND') { |
@@ -86,7 +86,7 @@ function login(uri) { | |||
86 | 86 | ||
87 | gQuery = { username: username, password: password }; | 87 | gQuery = { username: username, password: password }; |
88 | 88 | ||
89 | console.log('Ok'.green); | 89 | console.log('Login successful'.green); |
90 | }); | 90 | }); |
91 | } | 91 | } |
92 | 92 | ||