Skip to content

Commit

Permalink
Read params values from request header in different formats
Browse files Browse the repository at this point in the history
  • Loading branch information
wasifhossain committed Jun 11, 2018
1 parent 047fe4f commit ae9d23e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/controllers/devise_token_auth/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ def build_redirect_headers(access_token, client, redirect_header_options = {})

def params_for_resource(resource)
devise_parameter_sanitizer.instance_values['permitted'][resource].each do |type|
params[type.to_s] ||= request.headers[type.to_s] unless request.headers[type.to_s].nil?
key = 'HTTP_' + type.to_s.upcase
value_from_header = request.headers[type.to_s] || request.headers[key]
params[type.to_s] ||= value_from_header unless value_from_header.nil?
end
devise_parameter_sanitizer.instance_values['permitted'][resource]
end
Expand Down

0 comments on commit ae9d23e

Please sign in to comment.