Skip to content

Commit

Permalink
refactor: 使用 last_used_at 判断 token 失效时间
Browse files Browse the repository at this point in the history
  • Loading branch information
slowlyo committed Sep 23, 2024
1 parent b62704e commit eef1469
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Models/PersonalAccessToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function scopeWithInExpiration($query)
{
$expiration = config('admin.auth.token_expiration');

$query->when($expiration, fn($q) => $q->where('created_at', '>=', now()->subMinutes($expiration)));
$query->when($expiration, fn($q) => $q->where('last_used_at', '>=', now()->subMinutes($expiration)));

return $query;
}
Expand Down

0 comments on commit eef1469

Please sign in to comment.