From 07d601ea360c6eb303eab7055162cba0d9f7b0a5 Mon Sep 17 00:00:00 2001 From: Oliver Boehlk Date: Fri, 15 May 2020 23:03:04 +0200 Subject: [PATCH] bugfix password validation --- backend/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/index.js b/backend/index.js index abe8cde..e373d35 100644 --- a/backend/index.js +++ b/backend/index.js @@ -295,10 +295,10 @@ app.get('/API/resourcelist', function (req, res) { app.post("/API/user/setname", function (req, res) { let { email, password } = req.body; - if (email) { + if (email && password) { if (DEBUG) return res.status(status.OK).send(); try { - if (!await validatePassword(req.user.email, passport)) + if (!await validatePassword(req.user.email, password)) return res.status(status.UNAUTHORIZED).send("wrong password supplied"); } catch (e) { return res.status(status.INTERNAL_SERVER_ERROR).send(e);