projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3f64ba5
)
Add missing URL encoding in create authorization redirect
author
Dominique Feyer
<dfeyer@ttree.ch>
Sun, 9 Sep 2018 21:31:47 +0000
(23:31 +0200)
committer
Dominique Feyer
<dfeyer@ttree.ch>
Sun, 9 Sep 2018 21:31:47 +0000
(23:31 +0200)
lib/pleroma/web/oauth/oauth_controller.ex
patch
|
blob
|
history
diff --git
a/lib/pleroma/web/oauth/oauth_controller.ex
b/lib/pleroma/web/oauth/oauth_controller.ex
index 160cedd8ee304f3ab103e9097a630ea9fcbfa2f3..8fe0dde6e602d804d86427637aadb822edbb4f60 100644
(file)
--- a/
lib/pleroma/web/oauth/oauth_controller.ex
+++ b/
lib/pleroma/web/oauth/oauth_controller.ex
@@
-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