Changed default mercure token duration to 1 day

This commit is contained in:
Alejandro Celaya 2020-04-18 11:29:49 +02:00
parent 655fd58a9d
commit 078c8ea011
3 changed files with 2 additions and 3 deletions

View file

@ -13,7 +13,6 @@ return [
'public_hub_url' => null,
'internal_hub_url' => null,
'jwt_secret' => null,
'jwt_days_duration' => 5,
'jwt_issuer' => 'Shlink',
],

View file

@ -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 {

View file

@ -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();