From 8a25ff922376d5e50e74f23fa4bcb28c4e21e86e Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Tue, 3 Dec 2024 18:17:42 +0100 Subject: [PATCH] Fix timestamp serialization format for JWT tokens --- api/components/Tokens/Component.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/components/Tokens/Component.php b/api/components/Tokens/Component.php index 8ea8b33..9a9c2f2 100644 --- a/api/components/Tokens/Component.php +++ b/api/components/Tokens/Component.php @@ -62,7 +62,7 @@ class Component extends BaseComponent { */ public function create(array $payloads = [], array $headers = []): UnencryptedToken { $now = Carbon::now(); - $builder = (new Builder(new JoseEncoder(), ChainedFormatter::default()))->issuedAt($now->toDateTimeImmutable()); + $builder = (new Builder(new JoseEncoder(), ChainedFormatter::withUnixTimestampDates()))->issuedAt($now->toDateTimeImmutable()); if (isset($payloads['sub'])) { $builder = $builder->relatedTo($payloads['sub']); }