summaryrefslogtreecommitdiff
path: root/app/controllers/sessions_controller.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-11 18:09:23 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-11 18:09:23 +0000
commit76e9fc7b29c1ce716c26932e9fbec0f3c99f53f4 (patch)
treeb5ca8e3a6b2cf93b67257b38ee71e2efee177700 /app/controllers/sessions_controller.rb
parenta210c43e0aca0311cc1d3d381763b25979ec72dc (diff)
downloadgitlab-ce-76e9fc7b29c1ce716c26932e9fbec0f3c99f53f4.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers/sessions_controller.rb')
-rw-r--r--app/controllers/sessions_controller.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb
index e2dd2d77a30..01c23ce9db7 100644
--- a/app/controllers/sessions_controller.rb
+++ b/app/controllers/sessions_controller.rb
@@ -26,6 +26,8 @@ class SessionsController < Devise::SessionsController
before_action :load_recaptcha
before_action :frontend_tracking_data, only: [:new]
+ around_action :set_current_context
+
after_action :log_failed_login, if: :action_new_and_failed_login?
helper_method :captcha_enabled?, :captcha_on_login_required?
@@ -305,6 +307,13 @@ class SessionsController < Devise::SessionsController
# We want tracking data pushed to the frontend when the user is _in_ the control group
frontend_experimentation_tracking_data(:signup_flow, 'start') unless experiment_enabled?(:signup_flow)
end
+
+ def set_current_context(&block)
+ Gitlab::ApplicationContext.with_context(
+ user: -> { current_user },
+ caller_id: "#{self.class.name}##{action_name}",
+ &block)
+ end
end
SessionsController.prepend_if_ee('EE::SessionsController')