🚀 مُصادَق: تحديث برمجي جديد 2026-05-03 15:11

This commit is contained in:
Hamza-Ayed
2026-05-03 15:11:34 +03:00
parent 3aeb3220f1
commit 7cd2d91576
23 changed files with 1418 additions and 879 deletions

View File

@@ -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());
}
}
}