Skip to content

Commit

Permalink
Fixing parsing token header in reader (#19)
Browse files Browse the repository at this point in the history
* Fixing parsing token header in reader

* fixing test env
  • Loading branch information
akadlec authored Aug 29, 2024
1 parent 8ceb425 commit a4ab015
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Security/TokenReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]);

Expand Down
2 changes: 1 addition & 1 deletion tests/common.neon
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ fbSimpleAuth:
policy: %appDir%tests/fixtures/policy.csv

fbDateTimeFactory:
frozen: new DateTimeImmutable('2020-04-01T12:00:00+00:00')
frozen: DateTimeImmutable('2020-04-01T12:00:00+00:00')

0 comments on commit a4ab015

Please sign in to comment.