From 19299e7922f4ad3d2ee987e31e01d92fd84b3e6b Mon Sep 17 00:00:00 2001 From: Raphael Ouaknine Date: Mon, 1 Mar 2021 11:17:48 +0200 Subject: [PATCH] Update about the Life time Token validation If tokenLifeTime is initialized and higher than the current date, the token will be deleted after the validateRequest. I think that reusable->deleteToken() should return false to ensure that the token stay valid during his life time. --- src/Reusable.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Reusable.php b/src/Reusable.php index 1583345..66eb51d 100644 --- a/src/Reusable.php +++ b/src/Reusable.php @@ -82,6 +82,6 @@ public function deleteToken(array $token): bool } $dateTime = (new \DateTime($token['created-date']))->add($this->tokenLifetime); $now = new \DateTime(); - return $dateTime >= $now; + return $dateTime >= $now ? false : true; } }