Adds rate limiting to the login page

main
Yasen Pramatarov 2024-12-07 15:38:13 +02:00
parent fee0616ca4
commit f549940249
1 changed files with 44 additions and 40 deletions

View File

@ -22,6 +22,7 @@ try {
$dbWeb = connectDB($config); $dbWeb = connectDB($config);
if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) { if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
try {
$username = $_POST['username']; $username = $_POST['username'];
$password = $_POST['password']; $password = $_POST['password'];
@ -66,6 +67,9 @@ try {
header('Location: ' . htmlspecialchars($app_root)); header('Location: ' . htmlspecialchars($app_root));
exit(); exit();
} }
} catch (Exception $e) {
$error = $e->getMessage();
}
} }
} catch (Exception $e) { } catch (Exception $e) {
$error = getError('There was an unexpected error. Please try again.', $e->getMessage()); $error = getError('There was an unexpected error. Please try again.', $e->getMessage());