diff --git a/Controller/AuthorizeController.php b/Controller/AuthorizeController.php index 46c75fca..60ffe931 100644 --- a/Controller/AuthorizeController.php +++ b/Controller/AuthorizeController.php @@ -171,7 +171,11 @@ public function authorizeAction(Request $request) if ($event->isAuthorizedClient()) { $scope = $request->get('scope', null); - return $this->oAuth2Server->finishClientAuthorization(true, $user, $request, $scope); + try { + return $this->oAuth2Server->finishClientAuthorization(true, $user, $request, $scope); + } catch (OAuth2ServerException $e) { + return $e->getHttpResponse(); + } } if (true === $formHandler->process()) { @@ -213,7 +217,7 @@ protected function processSuccess(UserInterface $user, AuthorizeFormHandler $for try { return $this->oAuth2Server ->finishClientAuthorization($formHandler->isAccepted(), $user, $request, $formHandler->getScope()) - ; + ; } catch (OAuth2ServerException $e) { return $e->getHttpResponse(); }