mirror of
https://github.com/shlinkio/shlink.git
synced 2024-11-23 13:23:33 +03:00
Changed default mercure token duration to 1 day
This commit is contained in:
parent
655fd58a9d
commit
078c8ea011
3 changed files with 2 additions and 3 deletions
|
@ -13,7 +13,6 @@ return [
|
|||
'public_hub_url' => null,
|
||||
'internal_hub_url' => null,
|
||||
'jwt_secret' => null,
|
||||
'jwt_days_duration' => 5,
|
||||
'jwt_issuer' => 'Shlink',
|
||||
],
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue