diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-07-10 16:08:39 -0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-07-10 16:18:30 -0400 |
commit | 22724418d350001e2683b68fad65186af783d3f2 (patch) | |
tree | de5038198d8ab98bc9d592ce4a1437493010d30a /app/controllers/profiles | |
parent | 526813581b042bc6abad60eb4e582be81620be77 (diff) | |
download | gitlab-ce-22724418d350001e2683b68fad65186af783d3f2.tar.gz |
Add User#disable_two_factor!rs-disable-2fa
This method encapsulates all the logic for disabling 2FA on a specific
User model.
Diffstat (limited to 'app/controllers/profiles')
-rw-r--r-- | app/controllers/profiles/two_factor_auths_controller.rb | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/app/controllers/profiles/two_factor_auths_controller.rb b/app/controllers/profiles/two_factor_auths_controller.rb index 03845f1e1ec..f9af0871cf1 100644 --- a/app/controllers/profiles/two_factor_auths_controller.rb +++ b/app/controllers/profiles/two_factor_auths_controller.rb @@ -29,13 +29,7 @@ class Profiles::TwoFactorAuthsController < Profiles::ApplicationController end def destroy - current_user.update_attributes({ - two_factor_enabled: false, - encrypted_otp_secret: nil, - encrypted_otp_secret_iv: nil, - encrypted_otp_secret_salt: nil, - otp_backup_codes: nil - }) + current_user.disable_two_factor! redirect_to profile_account_path end |