logout.js 932 B

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