const query = `SELECT id FROM users WHERE username = '${user}' AND password = '${pass}';`; try { const id = db.prepare(query).get()?.id; if (!id) { return res.redirect("/?message=Incorrect username or password"); }
if (users[id] && isAdmin[user]) { return res.redirect("/?flag=" + encodeURIComponent(FLAG)); } return res.redirect("/?message=This system is currently only available to admins..."); } catch { return res.redirect("/?message=Nice try..."); } });
app.listen(PORT, () =>console.log(`web/funnylogin listening on port ${PORT}`));