diff --git a/src/Exception/OAuthServerException.php b/src/Exception/OAuthServerException.php index baf16f50..46a79c1a 100644 --- a/src/Exception/OAuthServerException.php +++ b/src/Exception/OAuthServerException.php @@ -243,9 +243,9 @@ class OAuthServerException extends \Exception $response = $response->withHeader($header, $content); } - return $response - ->withStatus($this->getHttpStatusCode()) - ->getBody()->write(json_encode($payload)); + $response = $response->withStatus($this->getHttpStatusCode()); + $response->getBody()->write(json_encode($payload)); + return $response; } /**