diff --git a/config/autoload/mercure.global.php b/config/autoload/mercure.global.php index 04a698c3..1a404dca 100644 --- a/config/autoload/mercure.global.php +++ b/config/autoload/mercure.global.php @@ -13,7 +13,6 @@ return [ 'public_hub_url' => null, 'internal_hub_url' => null, 'jwt_secret' => null, - 'jwt_days_duration' => 5, 'jwt_issuer' => 'Shlink', ], diff --git a/module/Rest/src/Action/MercureInfoAction.php b/module/Rest/src/Action/MercureInfoAction.php index 73526d9f..bad4cb9c 100644 --- a/module/Rest/src/Action/MercureInfoAction.php +++ b/module/Rest/src/Action/MercureInfoAction.php @@ -40,7 +40,7 @@ class MercureInfoAction extends AbstractRestAction throw MercureException::mercureNotConfigured(); } - $days = $this->mercureConfig['jwt_days_duration'] ?? 3; + $days = $this->mercureConfig['jwt_days_duration'] ?? 1; $expiresAt = Chronos::now()->addDays($days); try { diff --git a/module/Rest/test/Action/MercureInfoActionTest.php b/module/Rest/test/Action/MercureInfoActionTest.php index df4b7260..d40b3f70 100644 --- a/module/Rest/test/Action/MercureInfoActionTest.php +++ b/module/Rest/test/Action/MercureInfoActionTest.php @@ -92,7 +92,7 @@ class MercureInfoActionTest extends TestCase $this->assertArrayHasKey('token', $payload); $this->assertArrayHasKey('jwtExpiration', $payload); $this->assertEquals( - Chronos::now()->addDays($days ?? 3)->startOfDay(), + Chronos::now()->addDays($days ?? 1)->startOfDay(), Chronos::parse($payload['jwtExpiration'])->startOfDay(), ); $buildToken->shouldHaveBeenCalledOnce();