diff --git a/app.js b/app.js index 76e0cce..b637588 100644 --- a/app.js +++ b/app.js @@ -79,7 +79,7 @@ app.get('/login', (req, res) => { con.query("SELECT PASSWORT, USERNAME FROM ministranten WHERE (USERNAME='" + id + "' OR EMAIL='" + id + "')", (err, result) => { if (err) throw err; - if(password == result[0]["PASSWORT"]){ + if(result[0] != null && password == result[0]["PASSWORT"]){ var usertoken = uuid(); res.cookie("loginToken", usertoken); res.cookie("user", result[0]["USERNAME"]);