Skip to content

Commit

Permalink
Try to fix TU
Browse files Browse the repository at this point in the history
  • Loading branch information
ldaspt authored and Ludovic Daoudal committed Nov 23, 2023
1 parent 71ff07b commit f5346d6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions EventListener/BlockJWTListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ private function blockTokenFromRequest(Request $request): void

try {
$payload = $this->jwtManager->parse($token);
} catch (JWTDecodeFailureException) {
} catch (JWTDecodeFailureException $e) {
// Ignore decode failures, this would mean the token is invalid anyway
return;
}

try {
$this->tokenManager->add($payload);
} catch (MissingClaimException) {
} catch (MissingClaimException $e) {
// We can't block a token missing the claims our system requires, so silently ignore this one
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Lexik\Bundle\JWTAuthenticationBundle\Tests\Functional\Command;

use ApiPlatform\OpenApi\OpenApi;
use Lexik\Bundle\JWTAuthenticationBundle\Tests\Functional\TestCase;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Tester\CommandTester;
Expand All @@ -25,9 +26,10 @@ public function testCheckOpenApiExportCommand()
$tester = new CommandTester($app->find('api:openapi:export'));

$this->assertSame(0, $tester->execute([]));
$openApiVersion = class_exists(OpenApi::class) ? OpenApi::VERSION : '3.0.0';
$this->assertJsonStringEqualsJsonString(<<<JSON
{
"openapi": "3.0.0",
"openapi": "$openApiVersion",
"info": {
"description": "API Platform integration in LexikJWTAuthenticationBundle",
"title": "LexikJWTAuthenticationBundle",
Expand Down

0 comments on commit f5346d6

Please sign in to comment.