@shift-code/cli
Version:
Redeem Gearbox SHiFT codes automatically
23 lines • 955 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.logoutCommand = void 0;
const api_1 = require("@shift-code/api");
const chalk_1 = __importDefault(require("chalk"));
const cache_1 = require("../cache");
async function logoutCommand() {
const cache = await (0, cache_1.loadMetaCache)();
if (cache.activeAccountID) {
const { session } = await (0, cache_1.loadAccountCache)(cache.activeAccountID);
if (session) {
await (0, api_1.logout)(session).catch(() => void 0);
await (0, cache_1.clearAccountSession)(cache.activeAccountID);
}
await (0, cache_1.clearMetaActiveAccount)();
}
console.log(chalk_1.default.green('Logout successful'));
}
exports.logoutCommand = logoutCommand;
//# sourceMappingURL=logout.js.map