Skip to content

Commit

Permalink
feat(auth): Update auth:2fa:disable
Browse files Browse the repository at this point in the history
* Deprecation warning
* This has already been deprecated for anyone in the MFA beta, which
  went to GA on April 5, 2021.
* Next step will be to remove entirely
* https://salesforce.quip.com/JYsuAbKPJa0W#UaWABAZB3C9
  • Loading branch information
Jessie A. Young authored and fivetanley committed Apr 7, 2021
1 parent 61f81ee commit 57e1d00
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions packages/auth/src/commands/auth/2fa/disable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,7 @@ export default class Auth2faGenerate extends Command {
'2fa:disable',
]

static example = `$ heroku auth:2fa:disable
Disabling 2fa on [email protected]... done`

async run() {
cli.action.start('Disabling 2fa')
const headers = {Accept: 'application/vnd.heroku+json; version=3.with_vaas_info'}
const {body: account} = await this.heroku.get<Heroku.Account>('/account', {headers})
cli.action.start(`Disabling 2fa on ${account.email}`)
if (account.vaas_enrolled) this.error('Cannot disable 2fa via CLI\nPlease visit your Account page on the Heroku Dashboard to manage 2fa: https://dashboard.heroku.com/account')
if (!account.two_factor_authentication) this.error('2fa is already disabled')
const password = await cli.prompt('Password', {type: 'hide'})
await this.heroku.patch('/account', {body: {password, two_factor_authentication: false}})
cli.warn('DEPRECATION WARNING: this command has been removed, in favor of disabling MFA in your Account Settings in a browser.')
}
}

0 comments on commit 57e1d00

Please sign in to comment.