Skip to content

Commit

Permalink
Set authenticated user header for all requests
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve Laing committed Jun 6, 2016
1 parent c48d3fc commit e2d7e53
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 e2d7e53

Please sign in to comment.