diff options
Diffstat (limited to 'lib/classes/JsonApi/Middlewares/Authentication.php')
| -rw-r--r-- | lib/classes/JsonApi/Middlewares/Authentication.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/classes/JsonApi/Middlewares/Authentication.php b/lib/classes/JsonApi/Middlewares/Authentication.php index bbcfef1..19da101 100644 --- a/lib/classes/JsonApi/Middlewares/Authentication.php +++ b/lib/classes/JsonApi/Middlewares/Authentication.php @@ -2,10 +2,10 @@ namespace JsonApi\Middlewares; +use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface as Request; use Psr\Http\Server\RequestHandlerInterface as RequestHandler; -use Slim\Psr7\Response; class Authentication { @@ -58,9 +58,10 @@ class Authentication } // according to RFC 2616 - private function generateChallenges(array $guards): Response + private function generateChallenges(array $guards): ResponseInterface { - $response = new Response(401); + $responseFactory = app(ResponseFactoryInterface::class); + $response = $responseFactory->createResponse(401); foreach ($guards as $guard) { $response = $guard->addChallenge($response); |
