MCPcopy
hub / github.com/acode/cli / run

Method run

cli/commands/logout.js:32–56  ·  view source on GitHub ↗
(params, callback)

Source from the content-addressed store, hash-verified

30 }
31
32 run(params, callback) {
33
34 let host = params.flags.h ? params.flags.h[0] : 'https://api.autocode.com';
35 let port = params.flags.p && params.flags.p[0];
36
37 let force = !!(params.flags.f || params.vflags.force);
38
39 let resource = new APIResource(host, port);
40 resource.authorize(config.get('ACCESS_TOKEN'));
41
42 resource.request('v1/access_tokens').destroy(null, {}, (err, response) => {
43
44 if (!force && err) {
45 return callback(err);
46 }
47
48 config.set('ACCESS_TOKEN', '');
49 config.set('ACTIVE_LIBRARY_TOKEN', '');
50 config.unset('LIBRARY_TOKENS');
51 config.write();
52 return callback(null, 'Logged out successfully');
53
54 });
55
56 }
57
58}
59

Callers

nothing calls this directly

Calls 5

getMethod · 0.80
requestMethod · 0.80
setMethod · 0.80
unsetMethod · 0.80
writeMethod · 0.80

Tested by

no test coverage detected