diff options
-rw-r--r-- | cli/actions.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cli/actions.js b/cli/actions.js index 5ad9dc6..996ef7f 100644 --- a/cli/actions.js +++ b/cli/actions.js | |||
@@ -24,7 +24,7 @@ var gQuery = {}; | |||
24 | 24 | ||
25 | function checkConfig() { | 25 | function checkConfig() { |
26 | if (!config.server() || !config.accessToken()) { | 26 | if (!config.server() || !config.accessToken()) { |
27 | console.log('You have run "login" first'); | 27 | console.log('Run %s first', 'surfer login'.yellow); |
28 | process.exit(1); | 28 | process.exit(1); |
29 | } | 29 | } |
30 | 30 | ||
@@ -92,9 +92,9 @@ function login(uri) { | |||
92 | } | 92 | } |
93 | 93 | ||
94 | function logout() { | 94 | function logout() { |
95 | checkConfig(); | 95 | if (!config.accessToken()) return console.log('Done'.green); |
96 | 96 | ||
97 | superagent.post(config.server() + '/api/logout').query(gQuery).end(function (error, result) { | 97 | superagent.post(config.server() + '/api/logout').query({ access_token: config.accessToken() }).end(function (error, result) { |
98 | if (result && result.statusCode !== 200) console.log('Failed to logout: ' + result.statusCode); | 98 | if (result && result.statusCode !== 200) console.log('Failed to logout: ' + result.statusCode); |
99 | if (error) console.log(error); | 99 | if (error) console.log(error); |
100 | 100 | ||