mirror of
https://github.com/shlinkio/shlink.git
synced 2024-12-22 23:23:42 -06:00
Changed default mercure token duration to 1 day
This commit is contained in:
parent
655fd58a9d
commit
078c8ea011
@ -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…
Reference in New Issue
Block a user