"Improve database structure and templates for user login"
This commit is contained in:
@@ -454,13 +454,13 @@
|
||||
|
||||
{% block scripts %}
|
||||
<script>
|
||||
let loginAttempts = parseInt(localStorage.getItem('loginAttempts') || '0');
|
||||
let lastAttemptTime = parseInt(localStorage.getItem('lastAttemptTime') || '0');
|
||||
let isFormLocked = false;
|
||||
const MAX_ATTEMPTS = 5;
|
||||
const LOCKOUT_DURATION = 15 * 60 * 1000; // 15 minutes
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// TEMPORÄRES DEBUGGING: LocalStorage leeren
|
||||
console.log("Clearing login attempts from localStorage...");
|
||||
localStorage.removeItem('loginAttempts');
|
||||
localStorage.removeItem('lastAttemptTime');
|
||||
console.log("Login rate limiting reset");
|
||||
|
||||
initializeLoginForm();
|
||||
checkRateLimit();
|
||||
setupFormValidation();
|
||||
@@ -469,6 +469,12 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
setupAccessibility();
|
||||
});
|
||||
|
||||
let loginAttempts = parseInt(localStorage.getItem('loginAttempts') || '0');
|
||||
let lastAttemptTime = parseInt(localStorage.getItem('lastAttemptTime') || '0');
|
||||
let isFormLocked = false;
|
||||
const MAX_ATTEMPTS = 5;
|
||||
const LOCKOUT_DURATION = 15 * 60 * 1000; // 15 minutes
|
||||
|
||||
function initializeLoginForm() {
|
||||
const form = document.getElementById('loginForm');
|
||||
const submitBtn = document.getElementById('submitBtn');
|
||||
@@ -511,6 +517,10 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
const now = Date.now();
|
||||
const timeSinceLastAttempt = now - lastAttemptTime;
|
||||
|
||||
// TEMPORÄR DEAKTIVIERT FÜR DEBUGGING
|
||||
console.log("Rate Limiting temporär deaktiviert");
|
||||
return; // Frühes Return verhindert Rate Limiting
|
||||
|
||||
if (loginAttempts >= MAX_ATTEMPTS && timeSinceLastAttempt < LOCKOUT_DURATION) {
|
||||
const remainingTime = LOCKOUT_DURATION - timeSinceLastAttempt;
|
||||
showRateLimitWarning(remainingTime);
|
||||
|
Reference in New Issue
Block a user