summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2018-05-11 17:15:43 +0000
committerAlessio Caiazza <acaiazza@gitlab.com>2018-05-14 15:00:51 +0200
commit9cf92f40b0d17b1a55152b54b86e9f4270979db6 (patch)
tree721578b96cdbbd9881808dea8a9d63e9440aefb8 /app
parent665de9475a739402ceb6773761a4d267834181ae (diff)
downloadgitlab-ce-9cf92f40b0d17b1a55152b54b86e9f4270979db6.tar.gz
Merge branch 'bvl-fix-sign-out-on-terms' into 'master'
Allow a user to sign out when on the terms page Closes #46211 See merge request gitlab-org/gitlab-ce!18875
Diffstat (limited to 'app')
-rw-r--r--app/controllers/application_controller.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 2caffec66ac..2843d70c645 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -13,8 +13,7 @@ class ApplicationController < ActionController::Base
before_action :authenticate_sessionless_user!
before_action :authenticate_user!
- before_action :enforce_terms!, if: -> { Gitlab::CurrentSettings.current_application_settings.enforce_terms },
- unless: :peek_request?
+ before_action :enforce_terms!, if: :should_enforce_terms?
before_action :validate_user_service_ticket!
before_action :check_password_expiration
before_action :ldap_security_check
@@ -373,4 +372,10 @@ class ApplicationController < ActionController::Base
def peek_request?
request.path.start_with?('/-/peek')
end
+
+ def should_enforce_terms?
+ return false unless Gitlab::CurrentSettings.current_application_settings.enforce_terms
+
+ !(peek_request? || devise_controller?)
+ end
end