From 86bfd86ec25f64483eca239d0302dbfeac52521c Mon Sep 17 00:00:00 2001 From: Jack Date: Fri, 27 Aug 2021 19:08:25 +0100 Subject: [PATCH] additional backend check --- backend/api/controllers/result.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/api/controllers/result.js b/backend/api/controllers/result.js index 5acaaaf33..2405bc045 100644 --- a/backend/api/controllers/result.js +++ b/backend/api/controllers/result.js @@ -56,6 +56,9 @@ class ResultController { ) { return res.status(400).json({ message: "Bad input" }); } + if (result.wpm == result.raw && result.acc != 100) { + return res.status(400).json({ message: "Bad input" }); + } if ( (result.mode === "time" && result.mode2 < 15 && result.mode2 > 0) || (result.mode === "time" &&