Handle non-JSON responses in login flow

This commit is contained in:
2025-09-24 10:30:13 +02:00
parent 3217ed5871
commit f06cfb81dd
2 changed files with 10 additions and 2 deletions
-1
View File
@@ -9,7 +9,6 @@ const users = JSON.parse(fs.readFileSync('C:/Users/frederik/WebstormProjects/Bru
app.post('/login', (req, res) => {
const {username, password} = req.body;
const user = users.find(u => u.username === username && u.password === password);
if (user) {
res.send('Login erfolgreich');
} else {