Skip to content

Commit

Permalink
Merge pull request #200 from alphagov/set-authenticated-user-header-i…
Browse files Browse the repository at this point in the history
…n-sidekiq-work

Set authenticated user header in sidekiq work
  • Loading branch information
elliotcm committed Jun 7, 2016
2 parents 32576b0 + e2d7e53 commit fa24713
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class ApplicationController < ActionController::Base

include GDS::SSO::ControllerMethods
before_filter :require_signin_permission!
before_filter :set_authenticated_user_header

add_flash_types :success, :info, :warning, :danger

Expand Down Expand Up @@ -36,4 +37,10 @@ def require_gds_editor_permissions_to_edit_browse_pages!
def find_tag
@tag = Tag.find_by!(content_id: params[:tag_id])
end

def set_authenticated_user_header
if current_user && GdsApi::GovukHeaders.headers[:x_govuk_authenticated_user].nil?
GdsApi::GovukHeaders.set_header(:x_govuk_authenticated_user, current_user.uid)
end
end
end

0 comments on commit fa24713

Please sign in to comment.