From 204b4d9c1ef92f9094868652c825cdebdec939e6 Mon Sep 17 00:00:00 2001 From: "Nathanael d. Noblet" Date: Thu, 29 Sep 2022 18:38:37 -0600 Subject: [PATCH] Added IssuedAt to default JWT token --- src/Generator/TokenGenerator.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Generator/TokenGenerator.php b/src/Generator/TokenGenerator.php index af7d6ba..5ca58ba 100644 --- a/src/Generator/TokenGenerator.php +++ b/src/Generator/TokenGenerator.php @@ -43,6 +43,7 @@ public function getToken(string $uId, string $email, array $extraData = null, ?i ->issuedBy($this->issuer) ->permittedFor($this->audience) ->identifiedBy($this->id) + ->issuedAt(new DateTimeImmutable()) ->canOnlyBeUsedAfter(new DateTimeImmutable()) ->expiresAt(new DateTimeImmutable('@' . (time() + ($expiration > 0 ? $expiration : $this->expiration)))) ->withClaim('userId', $uId)