diff options
| author | Alex Barker <alex@1stleg.com> | 2017-09-15 19:17:43 +0300 |
|---|---|---|
| committer | Brent Shaffer <betterbrent@google.com> | 2017-09-15 19:17:43 +0300 |
| commit | ee2471c0c77c1a0d28c2a5f5eaa6930fab737d35 (patch) | |
| tree | 648296bc0f1a67421312196d3664d366392286fa | |
| parent | 60eae3b9db490a6c3182aa2e3c856b1e48ab06ee (diff) | |
| download | oauth2-server-php-psr-7.tar.xz | |
Fixed a problem with error rendering that was resulting in '[]' regardless of the error. (#832)psr-7
| -rw-r--r-- | src/OAuth2/Controller/TokenController.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/OAuth2/Controller/TokenController.php b/src/OAuth2/Controller/TokenController.php index a7e6b0e..e794adf 100644 --- a/src/OAuth2/Controller/TokenController.php +++ b/src/OAuth2/Controller/TokenController.php @@ -47,9 +47,9 @@ class TokenController implements TokenControllerInterface public function handleTokenRequest(RequestInterface $request, ResponseInterface $response) { - $errors = null; + $error = null; $body = new Stream('php://temp', 'rw'); - if ($token = $this->grantAccessToken($request, $errors)) { + if ($token = $this->grantAccessToken($request, $error)) { // @see http://tools.ietf.org/html/rfc6749#section-5.1 // server MUST disable caching in headers when tokens are involved $body->write(json_encode($token)); @@ -66,7 +66,7 @@ class TokenController implements TokenControllerInterface 'error_uri' => $error['uri'], )))); return $response - ->withStatus($errors['code'] == 'invalid_method' ? 405 : 400) + ->withStatus($error['code'] == 'invalid_method' ? 405 : 400) ->withBody($body); } |
