diff options
author | Roger Braun <roger@rogerbraun.net> | 2017-11-10 18:24:50 +0100 |
---|---|---|
committer | Roger Braun <roger@rogerbraun.net> | 2017-11-10 18:24:50 +0100 |
commit | fd12e585c98d4cd2cca45f8ff2c368e80d21e111 (patch) | |
tree | 92c62c13ba0581129df80454715e8fdbec7909ae /lib | |
parent | 1d3d66a841253a244e5166726ba4f3d1f21651c3 (diff) | |
download | pleroma-fd12e585c98d4cd2cca45f8ff2c368e80d21e111.tar.gz |
Handle existing redirect params.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/oauth/oauth_controller.ex | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/pleroma/web/oauth/oauth_controller.ex b/lib/pleroma/web/oauth/oauth_controller.ex index 841df8c32..e8483dec0 100644 --- a/lib/pleroma/web/oauth/oauth_controller.ex +++ b/lib/pleroma/web/oauth/oauth_controller.ex @@ -25,7 +25,8 @@ defmodule Pleroma.Web.OAuth.OAuthController do auth: auth } 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 <> "&state=#{params["state"]}" else |