I am trying to upgrade ueberauth_facebook with the recent version of oauth2. However the response from facebook is in this format access_token=xxxx&expires=yyy and the headers is {"Content-Type", "text/plain; charset=UTF-8"}. I understand that there is a special decoding for "application/x-www-form-urlencoded" content type, and also there is some way to use serializer. Is there any way to include this serializer only when parsing response from facebook? because I think text/plain is quite general.
Or I am thinking to add something like so in Response decoder:
defp decode_response_body(body, "text/plain") do
case URI.decode_query(body) do
%{"access_token" => _} = token -> token
_ -> body
end
end
I am trying to upgrade ueberauth_facebook with the recent version of oauth2. However the response from facebook is in this format
access_token=xxxx&expires=yyy
and the headers is{"Content-Type", "text/plain; charset=UTF-8"}
. I understand that there is a special decoding for"application/x-www-form-urlencoded"
content type, and also there is some way to use serializer. Is there any way to include this serializer only when parsing response from facebook? because I think text/plain is quite general.Or I am thinking to add something like so in Response decoder: