summaryrefslogtreecommitdiff
path: root/app/controllers/application_controller.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2016-01-20 20:04:15 +0100
committerDouwe Maan <douwe@selenight.nl>2016-01-20 20:04:15 +0100
commit7d347ae564c137bd8b133dd4d589b089bde931a5 (patch)
tree2004517d9c80fbd95359d2bd53842fa031415a72 /app/controllers/application_controller.rb
parent6000f8545f43b449035cb50382901ce40fb807b0 (diff)
parenta8a65afe1e953ce3a9fc151f9e033b99fc568fad (diff)
downloadgitlab-ce-7d347ae564c137bd8b133dd4d589b089bde931a5.tar.gz
Merge branch 'master' into issue_3945
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r--app/controllers/application_controller.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 8b62c11f7cc..2d735b90597 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -15,6 +15,7 @@ class ApplicationController < ActionController::Base
before_action :check_password_expiration
before_action :check_2fa_requirement
before_action :ldap_security_check
+ before_action :sentry_user_context
before_action :default_headers
before_action :add_gon_variables
before_action :configure_permitted_parameters, if: :devise_controller?
@@ -42,6 +43,16 @@ class ApplicationController < ActionController::Base
protected
+ def sentry_user_context
+ if Rails.env.production? && current_application_settings.sentry_enabled && current_user
+ Raven.user_context(
+ id: current_user.id,
+ email: current_user.email,
+ username: current_user.username,
+ )
+ end
+ end
+
# From https://github.com/plataformatec/devise/wiki/How-To:-Simple-Token-Authentication-Example
# https://gist.github.com/josevalim/fb706b1e933ef01e4fb6
def authenticate_user_from_token!