mirror of
https://github.com/shlinkio/shlink.git
synced 2025-03-29 04:52:54 +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,
|
'public_hub_url' => null,
|
||||||
'internal_hub_url' => null,
|
'internal_hub_url' => null,
|
||||||
'jwt_secret' => null,
|
'jwt_secret' => null,
|
||||||
'jwt_days_duration' => 5,
|
|
||||||
'jwt_issuer' => 'Shlink',
|
'jwt_issuer' => 'Shlink',
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ class MercureInfoAction extends AbstractRestAction
|
||||||
throw MercureException::mercureNotConfigured();
|
throw MercureException::mercureNotConfigured();
|
||||||
}
|
}
|
||||||
|
|
||||||
$days = $this->mercureConfig['jwt_days_duration'] ?? 3;
|
$days = $this->mercureConfig['jwt_days_duration'] ?? 1;
|
||||||
$expiresAt = Chronos::now()->addDays($days);
|
$expiresAt = Chronos::now()->addDays($days);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -92,7 +92,7 @@ class MercureInfoActionTest extends TestCase
|
||||||
$this->assertArrayHasKey('token', $payload);
|
$this->assertArrayHasKey('token', $payload);
|
||||||
$this->assertArrayHasKey('jwtExpiration', $payload);
|
$this->assertArrayHasKey('jwtExpiration', $payload);
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
Chronos::now()->addDays($days ?? 3)->startOfDay(),
|
Chronos::now()->addDays($days ?? 1)->startOfDay(),
|
||||||
Chronos::parse($payload['jwtExpiration'])->startOfDay(),
|
Chronos::parse($payload['jwtExpiration'])->startOfDay(),
|
||||||
);
|
);
|
||||||
$buildToken->shouldHaveBeenCalledOnce();
|
$buildToken->shouldHaveBeenCalledOnce();
|
||||||
|
|
Loading…
Add table
Reference in a new issue