Add missing URL encoding in create authorization redirect
This commit is contained in:
parent
3f64ba5fc8
commit
b79c126ee0
@ -39,15 +39,18 @@ defmodule Pleroma.Web.OAuth.OAuthController do
|
||||
})
|
||||
else
|
||||
connector = if String.contains?(redirect_uri, "?"), do: "&", else: "?"
|
||||
url = "#{redirect_uri}#{connector}code=#{auth.token}"
|
||||
url = "#{redirect_uri}#{connector}"
|
||||
url_params = %{:code => auth.token}
|
||||
|
||||
url =
|
||||
url_params =
|
||||
if params["state"] do
|
||||
url <> "&state=#{params["state"]}"
|
||||
Map.put(url_params, :state, params["state"])
|
||||
else
|
||||
url
|
||||
url_params
|
||||
end
|
||||
|
||||
url = "#{url}#{Plug.Conn.Query.encode url_params}"
|
||||
|
||||
redirect(conn, external: url)
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user