diff options
author | Markus Koller <markus-koller@gmx.ch> | 2017-03-07 19:48:57 +0100 |
---|---|---|
committer | Alexis Reigel <mail@koffeinfrei.org> | 2017-04-06 10:01:13 +0200 |
commit | 8e665140565a8c022bf1cad1589e244a543419fa (patch) | |
tree | d8bcdf4939b9fdcd1cc68ef98c1579575d0185a9 /app | |
parent | 7140e09e39895d747bca7238a5c9f5a4d4637a85 (diff) | |
download | gitlab-ce-8e665140565a8c022bf1cad1589e244a543419fa.tar.gz |
Rename check_2fa_requirement to check_two_factor_requirement
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/concerns/enforces_two_factor_authentication.rb | 8 | ||||
-rw-r--r-- | app/controllers/profiles/two_factor_auths_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/sessions_controller.rb | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/app/controllers/concerns/enforces_two_factor_authentication.rb b/app/controllers/concerns/enforces_two_factor_authentication.rb index b490f0058c7..05d427f83a0 100644 --- a/app/controllers/concerns/enforces_two_factor_authentication.rb +++ b/app/controllers/concerns/enforces_two_factor_authentication.rb @@ -2,18 +2,18 @@ # # Controller concern to enforce two-factor authentication requirements # -# Upon inclusion, adds `check_2fa_requirement` as a before_action, and -# makes `two_factor_grace_period_expired?` and `two_factor_skippable?` +# Upon inclusion, adds `check_two_factor_requirement` as a before_action, +# and makes `two_factor_grace_period_expired?` and `two_factor_skippable?` # available as view helpers. module EnforcesTwoFactorAuthentication extend ActiveSupport::Concern included do - before_action :check_2fa_requirement + before_action :check_two_factor_requirement helper_method :two_factor_grace_period_expired?, :two_factor_skippable? end - def check_2fa_requirement + def check_two_factor_requirement if two_factor_authentication_required? && current_user && !current_user.two_factor_enabled? && !skip_two_factor? redirect_to profile_two_factor_auth_path end diff --git a/app/controllers/profiles/two_factor_auths_controller.rb b/app/controllers/profiles/two_factor_auths_controller.rb index 26e7e93533e..5e54fdfcf44 100644 --- a/app/controllers/profiles/two_factor_auths_controller.rb +++ b/app/controllers/profiles/two_factor_auths_controller.rb @@ -1,5 +1,5 @@ class Profiles::TwoFactorAuthsController < Profiles::ApplicationController - skip_before_action :check_2fa_requirement + skip_before_action :check_two_factor_requirement def show unless current_user.otp_secret diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index d8561871098..d3091a4f8e9 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -3,7 +3,7 @@ class SessionsController < Devise::SessionsController include Devise::Controllers::Rememberable include Recaptcha::ClientHelper - skip_before_action :check_2fa_requirement, only: [:destroy] + skip_before_action :check_two_factor_requirement, only: [:destroy] prepend_before_action :check_initial_setup, only: [:new] prepend_before_action :authenticate_with_two_factor, |