From d22f222e65c03623d8a2c829f5b853ca3e52f0f9 Mon Sep 17 00:00:00 2001 From: liverbool Date: Sat, 13 Jan 2018 11:52:31 +0700 Subject: [PATCH] BUGFIX: Wrong redirect uri. This's bugfix when redirect on error. --- src/Grant/AuthCodeGrant.php | 4 ++-- src/Grant/ImplicitGrant.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Grant/AuthCodeGrant.php b/src/Grant/AuthCodeGrant.php index 6f2b6ff8..6a342228 100644 --- a/src/Grant/AuthCodeGrant.php +++ b/src/Grant/AuthCodeGrant.php @@ -249,9 +249,9 @@ class AuthCodeGrant extends AbstractAuthorizeGrant $scopes = $this->validateScopes( $this->getQueryStringParameter('scope', $request, $this->defaultScope), - is_array($client->getRedirectUri()) + $redirectUri ?: (is_array($client->getRedirectUri()) ? $client->getRedirectUri()[0] - : $client->getRedirectUri() + : $client->getRedirectUri()) ); $stateParameter = $this->getQueryStringParameter('state', $request); diff --git a/src/Grant/ImplicitGrant.php b/src/Grant/ImplicitGrant.php index f3c9e694..a10ac642 100644 --- a/src/Grant/ImplicitGrant.php +++ b/src/Grant/ImplicitGrant.php @@ -158,9 +158,9 @@ class ImplicitGrant extends AbstractAuthorizeGrant $scopes = $this->validateScopes( $this->getQueryStringParameter('scope', $request, $this->defaultScope), - is_array($client->getRedirectUri()) + $redirectUri ?: (is_array($client->getRedirectUri()) ? $client->getRedirectUri()[0] - : $client->getRedirectUri() + : $client->getRedirectUri()) ); // Finalize the requested scopes