diff --git a/helpers/functions.js b/helpers/functions.js index 106228d..d72ed7e 100644 --- a/helpers/functions.js +++ b/helpers/functions.js @@ -3,7 +3,7 @@ const got = require("got"); async function postUser(name, password) { console.log(process.env.BANKAPIURL); try { - const { body } = await got.get( + const { body } = await got.post( process.env.BANKAPIURL + "BankF/user/" + name, { headers: { diff --git a/index.js b/index.js index 70a73d5..b2abfb6 100644 --- a/index.js +++ b/index.js @@ -380,6 +380,7 @@ app.post("/login", async function (req, res) { req.session.password = password; res.redirect("/BankF"); } else if (verified.body.value == -1) { + req.session.errors = []; req.session.errors.push({ msg: "User not found" }); res.redirect("/login"); } else if (verified.body.value == 0) {