UNPKG

890 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const color_1 = require("../lib/color");
4const command_1 = require("../lib/command");
5class LogoutCommand extends command_1.Command {
6 async getMetadata() {
7 return {
8 name: 'logout',
9 type: 'global',
10 summary: 'Log out of Ionic',
11 description: `
12Remove the Ionic user token from the CLI config.
13
14Log in again with ${color_1.input('ionic login')}.
15
16If 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}
29exports.LogoutCommand = LogoutCommand;