summaryrefslogtreecommitdiff
path: root/app/controllers/profiles/two_factor_auths_controller.rb
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2017-06-16 11:12:06 +0200
committerJames Lopez <james@jameslopez.es>2017-06-23 11:41:42 +0200
commit158550cf37cc2db9590f0212962f10ecc73082de (patch)
tree3b48192a0eda2b96cf7de3c3f705a60346e18026 /app/controllers/profiles/two_factor_auths_controller.rb
parentbf3a3f3652704fb261e6220e2199830ea22ec8d3 (diff)
downloadgitlab-ce-158550cf37cc2db9590f0212962f10ecc73082de.tar.gz
added service in the rest of controllers and classes
Diffstat (limited to 'app/controllers/profiles/two_factor_auths_controller.rb')
-rw-r--r--app/controllers/profiles/two_factor_auths_controller.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/profiles/two_factor_auths_controller.rb b/app/controllers/profiles/two_factor_auths_controller.rb
index 313cdcd1c15..a8b7e756ad1 100644
--- a/app/controllers/profiles/two_factor_auths_controller.rb
+++ b/app/controllers/profiles/two_factor_auths_controller.rb
@@ -10,7 +10,7 @@ class Profiles::TwoFactorAuthsController < Profiles::ApplicationController
current_user.otp_grace_period_started_at = Time.current
end
- current_user.save! if current_user.changed?
+ Users::UpdateService.new(current_user, current_user).execute!
if two_factor_authentication_required? && !current_user.two_factor_enabled?
two_factor_authentication_reason(
@@ -43,7 +43,7 @@ class Profiles::TwoFactorAuthsController < Profiles::ApplicationController
if current_user.validate_and_consume_otp!(params[:pin_code])
current_user.otp_required_for_login = true
@codes = current_user.generate_otp_backup_codes!
- current_user.save!
+ Users::UpdateService.new(current_user, current_user).execute!
render 'create'
else
@@ -71,7 +71,7 @@ class Profiles::TwoFactorAuthsController < Profiles::ApplicationController
def codes
@codes = current_user.generate_otp_backup_codes!
- current_user.save!
+ Users::UpdateService.new(current_user, current_user).execute!
end
def destroy