aboutsummaryrefslogtreecommitdiffhomepage
path: root/cli/actions.js
diff options
context:
space:
mode:
Diffstat (limited to 'cli/actions.js')
-rw-r--r--cli/actions.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/cli/actions.js b/cli/actions.js
index 45656a6..065e700 100644
--- a/cli/actions.js
+++ b/cli/actions.js
@@ -1,6 +1,7 @@
1'use strict'; 1'use strict';
2 2
3exports.login = login; 3exports.login = login;
4exports.logout = logout;
4exports.put = put; 5exports.put = put;
5exports.get = get; 6exports.get = get;
6exports.del = del; 7exports.del = del;
@@ -92,6 +93,23 @@ function login(uri) {
92 }); 93 });
93} 94}
94 95
96function logout() {
97 checkConfig();
98
99 superagent.post(config.server() + '/api/logout').query(gQuery).end(function (error, result) {
100 if (result && result.statusCode !== 200) console.log('Failed to logout: ' + result.statusCode);
101 if (error) console.log(error);
102
103 // TODO remove at some point, this is just to clear the previous old version values
104 config.set('username', '');
105 config.set('password', '');
106 config.set('server', '');
107 config.set('accessToken', '');
108
109 console.log('Done'.green);
110 });
111}
112
95function put(filePath, otherFilePaths, options) { 113function put(filePath, otherFilePaths, options) {
96 checkConfig(); 114 checkConfig();
97 115