@tensorify.io/cli
Version:
Official CLI for Tensorify.io - Build, test, and deploy machine learning plugins
34 lines • 1.62 kB
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 commander_1 = require("commander");
const chalk_1 = __importDefault(require("chalk"));
const auth_service_1 = require("../auth/auth-service");
exports.logoutCommand = new commander_1.Command("logout")
.description("Sign out of Tensorify.io and clear stored authentication")
.action(async () => {
try {
// Check if user is currently authenticated
const isAuthenticated = await auth_service_1.authService.isAuthenticated();
if (!isAuthenticated) {
console.log(chalk_1.default.yellow("🔓 You're not currently logged in."));
console.log(chalk_1.default.gray("💡 Use 'tensorify login' to authenticate with Tensorify.io"));
return;
}
console.log(chalk_1.default.blue("🔓 Signing out of Tensorify.io..."));
// Clear the authentication session
await auth_service_1.authService.logout();
// Provide success feedback
console.log(chalk_1.default.green("✅ Successfully signed out!"));
console.log(chalk_1.default.gray("💡 Use 'tensorify login' to sign in again"));
}
catch (error) {
console.error(chalk_1.default.red("❌ Logout failed:"), error.message);
console.log(chalk_1.default.yellow("💡 You may need to manually clear your credentials"));
process.exit(1);
}
});
//# sourceMappingURL=logout.js.map