From 9fcc36faa85d0c4fad71ec7ae5a1a75c9e350bc8 Mon Sep 17 00:00:00 2001 From: Expand-sys Date: Wed, 11 Jan 2023 10:53:28 +1100 Subject: [PATCH] fix that should have been done when i last patched --- index.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 027b814..dbd022e 100644 --- a/index.js +++ b/index.js @@ -194,7 +194,10 @@ fastify.get( }*/ - log.reverse() + if(log){ + log.reverse() + } + for(i = 0; i < log.length; i++){ @@ -307,7 +310,12 @@ fastify.post("/login", async function (req, res) { if (req.session.get("user")) { res.redirect("/"); } - const { name, password } = req.body; + const { name, password, score, success } = req.body; + console.log(success, score) + if( score <= 0.2 && success == true){ + req.session.set("errors", "failed captcha") + res.redirect("/login") + } let auth = Buffer.from(`${name}:${password}`).toString('base64'); auth = `Basic ${auth}`;