Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-07-10 23:08:39 +0300
committerRobert Speicher <rspeicher@gmail.com>2015-07-10 23:18:30 +0300
commit22724418d350001e2683b68fad65186af783d3f2 (patch)
treede5038198d8ab98bc9d592ce4a1437493010d30a /app/controllers/profiles/two_factor_auths_controller.rb
parent526813581b042bc6abad60eb4e582be81620be77 (diff)
Add User#disable_two_factor!
This method encapsulates all the logic for disabling 2FA on a specific User model.
Diffstat (limited to 'app/controllers/profiles/two_factor_auths_controller.rb')
-rw-r--r--app/controllers/profiles/two_factor_auths_controller.rb8
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