From f0f73559b883e10cb66b7eb78de594bc5cd30d14 Mon Sep 17 00:00:00 2001 From: mychidarko Date: Tue, 12 Nov 2024 19:28:17 +0000 Subject: [PATCH] fix: translate non-numeric lifetimes --- src/Auth/User.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Auth/User.php b/src/Auth/User.php index 785420e..45ab149 100644 --- a/src/Auth/User.php +++ b/src/Auth/User.php @@ -71,6 +71,10 @@ public function __construct($data) } } + $sessionLifetime = !is_numeric($sessionLifetime) + ? strtotime($sessionLifetime) + : (time() + $sessionLifetime); + $this->tokens['access'] = $this->generateToken($sessionLifetime); $this->tokens['refresh'] = $this->generateToken($sessionLifetime + 259200); }