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);