Skip to content
This repository has been archived by the owner on Dec 1, 2022. It is now read-only.

Commit

Permalink
make user parameter not empty for API requests in users controller
Browse files Browse the repository at this point in the history
  • Loading branch information
kelly-croswell committed Sep 3, 2019
1 parent b3a344c commit f3a2cdd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ class ApplicationController < ActionController::Base
include Pundit
include AuthorizationForcedRedirects
before_action do
params[:user] = { email: request.headers["X-Pharos-API-User"] } if api_request? && params[:controller] == 'users'

resource = controller_path.singularize.gsub('/', '_').to_sym
method = "#{resource}_params"
params[resource] &&= send(method) if respond_to?(method, true)
Expand Down

0 comments on commit f3a2cdd

Please sign in to comment.