bugfix password validation
This commit is contained in:
@@ -295,10 +295,10 @@ app.get('/API/resourcelist', function (req, res) {
|
|||||||
|
|
||||||
app.post("/API/user/setname", function (req, res) {
|
app.post("/API/user/setname", function (req, res) {
|
||||||
let { email, password } = req.body;
|
let { email, password } = req.body;
|
||||||
if (email) {
|
if (email && password) {
|
||||||
if (DEBUG) return res.status(status.OK).send();
|
if (DEBUG) return res.status(status.OK).send();
|
||||||
try {
|
try {
|
||||||
if (!await validatePassword(req.user.email, passport))
|
if (!await validatePassword(req.user.email, password))
|
||||||
return res.status(status.UNAUTHORIZED).send("wrong password supplied");
|
return res.status(status.UNAUTHORIZED).send("wrong password supplied");
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return res.status(status.INTERNAL_SERVER_ERROR).send(e);
|
return res.status(status.INTERNAL_SERVER_ERROR).send(e);
|
||||||
|
|||||||
Reference in New Issue
Block a user