BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
0ad6b44a
Commit
0ad6b44a
authored
Jan 20, 2016
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Send user context to Sentry
parent
7a609858
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
application_controller.rb
app/controllers/application_controller.rb
+11
-0
No files found.
app/controllers/application_controller.rb
View file @
0ad6b44a
...
...
@@ -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?
...
...
@@ -41,6 +42,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!
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment