From 4c8cd1991232312c6c17a85e41446c1f0d057dcf Mon Sep 17 00:00:00 2001 From: fretuks Date: Wed, 22 Oct 2025 13:37:07 +0200 Subject: [PATCH] Remove unneeded --- public/Backend.js | 9 --------- 1 file changed, 9 deletions(-) diff --git a/public/Backend.js b/public/Backend.js index 4a6b294..54363ad 100644 --- a/public/Backend.js +++ b/public/Backend.js @@ -26,7 +26,6 @@ app.post('/login', async (req, res) => { const ip = req.ip || req.connection.remoteAddress; const user = users.find(u => u.username === username && u.password === password); const now = Date.now(); - if (!loginAttempts[username]) { loginAttempts[username] = { count: 0, @@ -36,10 +35,7 @@ app.post('/login', async (req, res) => { cooldownUntil: null }; } - const state = loginAttempts[username]; - - // 🔹 Lockout aktiv? if (state.lockedUntil && now < state.lockedUntil) { const remaining = Math.ceil((state.lockedUntil - now) / 1000); logAttempt(username, 'LOCKED', ip, `Noch gesperrt: ${remaining}s`); @@ -48,8 +44,6 @@ app.post('/login', async (req, res) => { error: `Benutzer gesperrt. Bitte in ${remaining}s erneut versuchen.` }); } - - // 🔹 Cooldown aktiv? if (state.cooldownUntil && now < state.cooldownUntil) { const remaining = Math.ceil((state.cooldownUntil - now) / 1000); logAttempt(username, 'COOLDOWN', ip, `Wartezeit noch ${remaining}s`); @@ -59,8 +53,6 @@ app.post('/login', async (req, res) => { requiresCaptcha: state.requiresCaptcha }); } - - // 🔹 Captcha-Prüfung (falls aktiv) if (state.requiresCaptcha) { if (!captcha || typeof captcha !== 'string') { logAttempt(username, 'CAPTCHA_MISSING', ip); @@ -125,7 +117,6 @@ app.post('/login', async (req, res) => { }); }); -// Einfaches Frontend für Tests app.get('/login', (req, res) => { res.sendFile(__dirname + '/index.html'); });