@shift-code/cli
Version:
Redeem Gearbox SHiFT codes automatically
22 lines • 944 B
JavaScript
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.logoutCommand = logoutCommand;
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)(cache.activeAccountID);
}
console.log(chalk_1.default.green('Logout successful'));
}
//# sourceMappingURL=logout.js.map
;