This commit is contained in:
2026-03-07 21:20:57 -06:00
parent 1906ca329c
commit f0a36ca06f

View File

@@ -38,6 +38,15 @@ class User extends Authenticatable
];
}
public function jwtNeedsRefresh(int $refreshIntervalSeconds = 3600): bool
{
if (blank($this->user_jwt) || ! $this->user_jwt_issued_at) {
return true;
}
return $this->user_jwt_issued_at->lte(now()->subSeconds($refreshIntervalSeconds));
}
public function markPrivilegesChanged(): void
{
$this->increment('privileges_version');