1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const color_1 = require("../lib/color");
|
4 | const command_1 = require("../lib/command");
|
5 | class LogoutCommand extends command_1.Command {
|
6 | async getMetadata() {
|
7 | return {
|
8 | name: 'logout',
|
9 | type: 'global',
|
10 | summary: 'Log out of Ionic',
|
11 | description: `
|
12 | Remove the Ionic user token from the CLI config.
|
13 |
|
14 | Log in again with ${color_1.input('ionic login')}.
|
15 |
|
16 | If you need to create an Ionic account, use ${color_1.input('ionic signup')}.
|
17 | `,
|
18 | };
|
19 | }
|
20 | async run(inputs, options) {
|
21 | if (!this.env.session.isLoggedIn()) {
|
22 | this.env.log.msg('You are already logged out.');
|
23 | return;
|
24 | }
|
25 | await this.env.session.logout();
|
26 | this.env.log.ok('You are logged out.');
|
27 | }
|
28 | }
|
29 | exports.LogoutCommand = LogoutCommand;
|