Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
app/controllers/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