Handle existing redirect params.

This commit is contained in:
Roger Braun 2017-11-10 18:24:50 +01:00
parent 1d3d66a841
commit fd12e585c9

View file

@ -25,7 +25,8 @@ def create_authorization(conn, %{"authorization" => %{"name" => name, "password"
auth: auth auth: auth
} }
else else
url = "#{redirect_uri}?code=#{auth.token}" connector = if String.contains?(redirect_uri, "?"), do: "&", else: "?"
url = "#{redirect_uri}#{connector}code=#{auth.token}"
url = if params["state"] do url = if params["state"] do
url <> "&state=#{params["state"]}" url <> "&state=#{params["state"]}"
else else