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 Nov 27, 2017
1 parent 4b1f20a commit a2654e9
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 @@ -33,7 +33,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 a2654e9

Please sign in to comment.