Prepare for logging

Yasen Pramatarov 2025-01-03 17:02:49 +02:00
parent 0d05d66c0f
commit 76f4e0e3c8
1 changed files with 2 additions and 0 deletions

View File

@ -2,6 +2,7 @@
class RateLimiter { class RateLimiter {
private $db; private $db;
private $log;
private $maxAttempts = 5; // Maximum login attempts private $maxAttempts = 5; // Maximum login attempts
private $decayMinutes = 15; // Time window in minutes private $decayMinutes = 15; // Time window in minutes
private $ratelimitTable = 'login_attempts'; private $ratelimitTable = 'login_attempts';
@ -9,6 +10,7 @@ class RateLimiter {
public function __construct($database) { public function __construct($database) {
$this->db = $database->getConnection(); $this->db = $database->getConnection();
$this->log = new Log($database);
$this->createTablesIfNotExists(); $this->createTablesIfNotExists();
} }