Skip to content

Commit f997932

Browse files
authored
Merge pull request #3555 from nhsuk/track-users-in-sentry
Track user IDs in Sentry
2 parents 1e08edc + a28d080 commit f997932

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

app/controllers/application_controller.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class ApplicationController < ActionController::Base
1414
before_action :set_service_guide_url
1515
before_action :set_show_navigation
1616
before_action :set_privacy_policy_url
17+
before_action :set_sentry_user
1718
before_action :authenticate_basic
1819

1920
after_action :verify_policy_scoped, if: -> { Rails.env.local? }
@@ -75,4 +76,8 @@ def set_service_guide_url
7576
def set_privacy_policy_url
7677
@privacy_policy_url = nil
7778
end
79+
80+
def set_sentry_user
81+
Sentry.set_user(id: current_user&.id)
82+
end
7883
end

0 commit comments

Comments
 (0)