summaryrefslogtreecommitdiff
path: root/app/controllers/profiles/two_factor_auths_controller.rb
diff options
context:
space:
mode:
authorGabriel Mazetto <gabriel@gitlab.com>2015-12-24 18:58:46 -0200
committerGabriel Mazetto <gabriel@gitlab.com>2015-12-24 19:01:30 -0200
commit1249289f89feba725109ce769e685b07cf746e4b (patch)
tree6fca6541c5667a41a36b2824fe0053e14c5e74f5 /app/controllers/profiles/two_factor_auths_controller.rb
parent6e3fb5024addf86d48c5723168f664d09d81a969 (diff)
downloadgitlab-ce-1249289f89feba725109ce769e685b07cf746e4b.tar.gz
Fixed codestyle and added 2FA documentationfeature/force-tfa
Diffstat (limited to 'app/controllers/profiles/two_factor_auths_controller.rb')
-rw-r--r--app/controllers/profiles/two_factor_auths_controller.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/profiles/two_factor_auths_controller.rb b/app/controllers/profiles/two_factor_auths_controller.rb
index 4f125eb7e05..6e91d9b4ad9 100644
--- a/app/controllers/profiles/two_factor_auths_controller.rb
+++ b/app/controllers/profiles/two_factor_auths_controller.rb
@@ -1,13 +1,15 @@
class Profiles::TwoFactorAuthsController < Profiles::ApplicationController
- skip_before_action :check_tfa_requirement
+ skip_before_action :check_2fa_requirement
def new
unless current_user.otp_secret
current_user.otp_secret = User.generate_otp_secret(32)
end
+
unless current_user.otp_grace_period_started_at && two_factor_grace_period
current_user.otp_grace_period_started_at = Time.current
end
+
current_user.save! if current_user.changed?
if two_factor_grace_period_expired?