Skip to content

Commit

Permalink
fix(mercure): prevent float for exp claim
Browse files Browse the repository at this point in the history
  • Loading branch information
Grafikart committed Nov 1, 2024
1 parent d821d44 commit 29b8d0e
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ public function setMercureCookie(ResponseEvent $event): void
// On part du clear cookie, pour le modifier et utiliser la clef d'abonnement.
$cookie = $this->authorization->createClearCookie($request, null)
->withExpires(0)
->withValue($this->tokenFactory->create($channels, null));
->withValue($this->tokenFactory->create($channels, null, [
// We need to set a date without ms to avoid float in "exp"
'exp' => new \DateTimeImmutable("@" . $exp->getTimestamp()),
]));
$response->headers->setCookie($cookie);
}
}

0 comments on commit 29b8d0e

Please sign in to comment.