🚀 مُصادَق: تحديث برمجي جديد 2026-05-03 15:11
This commit is contained in:
@@ -144,4 +144,14 @@ final class AuthService
|
||||
|
||||
return $this->login($data['email'], $data['password']);
|
||||
}
|
||||
public function logout(string $jti, int $remaining): void
|
||||
{
|
||||
// Blacklist the JTI for its remaining lifetime
|
||||
try {
|
||||
$redis = \App\Core\Redis::getInstance();
|
||||
$redis->setex('jwt_blacklist:' . $jti, max($remaining, 1), '1');
|
||||
} catch (\Throwable $e) {
|
||||
error_log('[AUTH] Could not blacklist JTI: ' . $e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user