From: Roger Braun Date: Fri, 10 Nov 2017 17:24:50 +0000 (+0100) Subject: Handle existing redirect params. X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=fd12e585c98d4cd2cca45f8ff2c368e80d21e111;p=akkoma Handle existing redirect params. --- 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