diff --git a/src/Server/HeimdallResourceServer.php b/src/Server/HeimdallResourceServer.php index 058edd2..e2cc1c4 100644 --- a/src/Server/HeimdallResourceServer.php +++ b/src/Server/HeimdallResourceServer.php @@ -63,10 +63,10 @@ function handleException(Exception $exception) * @param RequestInterface $request * @throws HeimdallServerException */ - function validate(RequestInterface $request) + function validate(RequestInterface &$request) { try { - return $this->server->validateAuthenticatedRequest( + $response = $this->server->validateAuthenticatedRequest( Heimdall::handleRequest( new IncomingRequest(config('app'), $request->uri, $request->getBody(), @@ -74,6 +74,7 @@ function validate(RequestInterface $request) ) ) ); + $request->setHeader('authorization', $response->getAttributes()); } catch (OAuthServerException $exception) { throw new HeimdallServerException( $exception->getMessage(),