Skip to content

Commit

Permalink
fix: translate non-numeric lifetimes
Browse files Browse the repository at this point in the history
  • Loading branch information
mychidarko committed Nov 12, 2024
1 parent cafd615 commit f0f7355
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Auth/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit f0f7355

Please sign in to comment.