Moves to App API
parent
a030562071
commit
3b50d81fb4
|
|
@ -9,7 +9,7 @@ use App\App;
|
||||||
*/
|
*/
|
||||||
class Register {
|
class Register {
|
||||||
/**
|
/**
|
||||||
* @var PDO|null $db The database connection instance.
|
* @var PDO $db The database connection instance.
|
||||||
*/
|
*/
|
||||||
private $db;
|
private $db;
|
||||||
private $rateLimiter;
|
private $rateLimiter;
|
||||||
|
|
@ -18,16 +18,14 @@ class Register {
|
||||||
/**
|
/**
|
||||||
* Register constructor.
|
* Register constructor.
|
||||||
* Initializes the database connection using App API.
|
* Initializes the database connection using App API.
|
||||||
*
|
|
||||||
* @param PDO|null $database The database connection (optional, will use App::db() if not provided).
|
|
||||||
*/
|
*/
|
||||||
public function __construct($database = null) {
|
public function __construct() {
|
||||||
$this->db = $database instanceof PDO ? $database : App::db();
|
$this->db = App::db();
|
||||||
|
|
||||||
require_once APP_PATH . 'classes/ratelimiter.php';
|
require_once APP_PATH . 'classes/ratelimiter.php';
|
||||||
require_once APP_PATH . 'classes/twoFactorAuth.php';
|
require_once APP_PATH . 'classes/twoFactorAuth.php';
|
||||||
|
|
||||||
$this->rateLimiter = new RateLimiter($this->db);
|
$this->rateLimiter = new RateLimiter();
|
||||||
$this->twoFactorAuth = new TwoFactorAuthentication($this->db);
|
$this->twoFactorAuth = new TwoFactorAuthentication($this->db);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue