From 8c79511746a0b03d85ac71b942b2c66420555572 Mon Sep 17 00:00:00 2001 From: Mohammed Tirichine Date: Sat, 23 Mar 2024 18:14:32 +0100 Subject: [PATCH 1/2] Fixing getMinutesUntilExpired error * the difference in minutes should be calculated with abs(), since diffInMinutes does: now - this (resulting in a negative value) --- src/Blacklist.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Blacklist.php b/src/Blacklist.php index ba12405b..01f40279 100644 --- a/src/Blacklist.php +++ b/src/Blacklist.php @@ -97,7 +97,7 @@ protected function getMinutesUntilExpired(Payload $payload) // get the latter of the two expiration dates and find // the number of minutes until the expiration date, // plus 1 minute to avoid overlap - return $exp->max($iat->addMinutes($this->refreshTTL))->addMinute()->diffInRealMinutes(); + return $exp->max($iat->addMinutes($this->refreshTTL))->addMinute()->diffInMinutes(absolute: true); } /** From d8ff9ec513d307b55c4ea5affb42f8bd2fdbdfeb Mon Sep 17 00:00:00 2001 From: Mohammed Tirichine Date: Sat, 23 Mar 2024 18:32:51 +0100 Subject: [PATCH 2/2] Ensure that minutes difference is "int" --- src/Blacklist.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Blacklist.php b/src/Blacklist.php index 01f40279..2ed3f574 100644 --- a/src/Blacklist.php +++ b/src/Blacklist.php @@ -97,7 +97,7 @@ protected function getMinutesUntilExpired(Payload $payload) // get the latter of the two expiration dates and find // the number of minutes until the expiration date, // plus 1 minute to avoid overlap - return $exp->max($iat->addMinutes($this->refreshTTL))->addMinute()->diffInMinutes(absolute: true); + return (int) $exp->max($iat->addMinutes($this->refreshTTL))->addMinute()->diffInMinutes(absolute: true); } /**