Skip to content

Commit

Permalink
AuthorizationMiddleware: polish types
Browse files Browse the repository at this point in the history
  • Loading branch information
f3l1x committed Feb 4, 2025
1 parent ab77961 commit bdc9c9b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Middleware/AuthorizationMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ public function __invoke(ServerRequestInterface $request, callable $next): mixed
return ErrorResponse::create()->withStatusCode(StatusCodeInterface::STATUS_UNAUTHORIZED)->withMessage('Unauthorized');
}

/** @var string|false|null $token */
/** @var string|null $token */
$token = explode(' ', $headerToken)[1] ?? null;

if ($token === false || $token === null) {
if ($token === null) {
return ErrorResponse::create()->withStatusCode(StatusCodeInterface::STATUS_FORBIDDEN)->withMessage('Missing token');
}

Expand Down

0 comments on commit bdc9c9b

Please sign in to comment.