From c07a3115fec249e0559a767bb7d1b3f040d93b29 Mon Sep 17 00:00:00 2001 From: Adam Kadlec Date: Thu, 29 Aug 2024 21:15:00 +0200 Subject: [PATCH] Fixing parsing token header in reader --- src/Security/TokenReader.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Security/TokenReader.php b/src/Security/TokenReader.php index d3e9346..b60754f 100644 --- a/src/Security/TokenReader.php +++ b/src/Security/TokenReader.php @@ -55,7 +55,8 @@ public function read(ServerRequestInterface $request): JWT\UnencryptedToken|null if ( is_string($headerJWT) - && preg_match(SimpleAuth\Constants::TOKEN_HEADER_REGEXP, $headerJWT, $matches) !== false + && preg_match(SimpleAuth\Constants::TOKEN_HEADER_REGEXP, $headerJWT, $matches) === 1 + && $matches[1] !== '' ) { $token = $this->tokenValidator->validate($matches[1]);