mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-07 03:29:19 +02:00
fix: call RateLimit::checkKey() as instance method in request-access.php
This commit is contained in:
@@ -87,7 +87,7 @@ if ($accessTypeId !== 2) {
|
|||||||
|
|
||||||
// Rate limiting: max 3 requests per 10 minutes per IP
|
// Rate limiting: max 3 requests per 10 minutes per IP
|
||||||
$rateLimitKey = 'access_request_' . ($_SERVER['REMOTE_ADDR'] ?? 'unknown');
|
$rateLimitKey = 'access_request_' . ($_SERVER['REMOTE_ADDR'] ?? 'unknown');
|
||||||
if (!RateLimit::check($rateLimitKey, 3, 600)) {
|
if (!(new RateLimit(3, 600))->checkKey($rateLimitKey)) {
|
||||||
http_response_code(429);
|
http_response_code(429);
|
||||||
echo json_encode(['success' => false, 'message' => 'Trop de requêtes. Veuillez réessayer dans quelques minutes.']);
|
echo json_encode(['success' => false, 'message' => 'Trop de requêtes. Veuillez réessayer dans quelques minutes.']);
|
||||||
exit;
|
exit;
|
||||||
|
|||||||
Reference in New Issue
Block a user