Use the error returned from the response type

This commit is contained in:
Alex Bilbie 2016-01-17 14:56:06 +00:00
parent 212938d1e2
commit f1d06e7c33

View File

@ -43,7 +43,7 @@ class ResourceServerMiddleware
$request = $this->server->getResponseType()->determineAccessTokenInHeader($request); $request = $this->server->getResponseType()->determineAccessTokenInHeader($request);
if ($request->getAttribute('oauth_access_token') === null) { if ($request->getAttribute('oauth_access_token') === null) {
$exception = OAuthServerException::accessDenied('Access token was invalid'); $exception = OAuthServerException::accessDenied($request->getAttribute('oauth_access_token_error'));
return $exception->generateHttpResponse($response); return $exception->generateHttpResponse($response);
} }