diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-20 21:38:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-20 21:38:24 +0300 |
commit | 983a0bba5d2a042c4a3bbb22432ec192c7501d82 (patch) | |
tree | b153cd387c14ba23bd5a07514c7c01fddf6a78a0 /app/controllers/concerns | |
parent | a2bddee2cdb38673df0e004d5b32d9f77797de64 (diff) |
Add latest changes from gitlab-org/gitlab@12-10-stable-ee
Diffstat (limited to 'app/controllers/concerns')
-rw-r--r-- | app/controllers/concerns/enforces_two_factor_authentication.rb | 8 | ||||
-rw-r--r-- | app/controllers/concerns/integrations_actions.rb | 4 |
2 files changed, 8 insertions, 4 deletions
diff --git a/app/controllers/concerns/enforces_two_factor_authentication.rb b/app/controllers/concerns/enforces_two_factor_authentication.rb index 825181568ad..d486d734db8 100644 --- a/app/controllers/concerns/enforces_two_factor_authentication.rb +++ b/app/controllers/concerns/enforces_two_factor_authentication.rb @@ -16,7 +16,7 @@ module EnforcesTwoFactorAuthentication end def check_two_factor_requirement - if two_factor_authentication_required? && current_user && !current_user.temp_oauth_email? && !current_user.two_factor_enabled? && !skip_two_factor? + if two_factor_authentication_required? && current_user_requires_two_factor? redirect_to profile_two_factor_auth_path end end @@ -27,6 +27,10 @@ module EnforcesTwoFactorAuthentication current_user.try(:ultraauth_user?) end + def current_user_requires_two_factor? + current_user && !current_user.temp_oauth_email? && !current_user.two_factor_enabled? && !skip_two_factor? + end + # rubocop: disable CodeReuse/ActiveRecord def two_factor_authentication_reason(global: -> {}, group: -> {}) if two_factor_authentication_required? @@ -61,3 +65,5 @@ module EnforcesTwoFactorAuthentication session[:skip_two_factor] && session[:skip_two_factor] > Time.current end end + +EnforcesTwoFactorAuthentication.prepend_if_ee('EE::EnforcesTwoFactorAuthentication') diff --git a/app/controllers/concerns/integrations_actions.rb b/app/controllers/concerns/integrations_actions.rb index 4c998055a5d..ff283f9bb62 100644 --- a/app/controllers/concerns/integrations_actions.rb +++ b/app/controllers/concerns/integrations_actions.rb @@ -15,9 +15,7 @@ module IntegrationsActions end def update - integration.attributes = service_params[:service] - - saved = integration.save(context: :manual_change) + saved = integration.update(service_params[:service]) respond_to do |format| format.html do |