"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const command_1 = require("@heroku-cli/command");
const cli_ux_1 = require("cli-ux");
class Auth2faGenerate extends command_1.Command {
    async run() {
        cli_ux_1.default.action.start('Disabling 2fa');
        const { body: account } = await this.heroku.get('/account');
        cli_ux_1.default.action.start(`Disabling 2fa on ${account.email}`);
        if (!account.two_factor_authentication)
            this.error('2fa is already disabled');
        const password = await cli_ux_1.default.prompt('Password', { type: 'hide' });
        await this.heroku.patch('/account', { body: { password, two_factor_authentication: false } });
    }
}
exports.default = Auth2faGenerate;
Auth2faGenerate.description = 'disables 2fa on account';
Auth2faGenerate.aliases = [
    'twofactor:disable',
    '2fa:disable',
];
Auth2faGenerate.example = `$ heroku auth:2fa:disable
Disabling 2fa on me@example.com... done`;
