From 3c0d93c7d7c876129d851032a88e7a3e64dba178 Mon Sep 17 00:00:00 2001 From: Avris Date: Thu, 9 Sep 2021 20:09:06 +0200 Subject: [PATCH] =?UTF-8?q?[user][bug]=20validate=20NEW=20email,=20not=20t?= =?UTF-8?q?he=20old=20one=20=F0=9F=A4=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/routes/user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/routes/user.js b/server/routes/user.js index 59945697..4a83e918 100644 --- a/server/routes/user.js +++ b/server/routes/user.js @@ -306,7 +306,7 @@ router.post('/user/change-email', handleErrorAsync(async (req, res) => { return res.status(401).json({error: 'Unauthorised'}); } - if (!await validateEmail(normalise(req.user.email))) { + if (!await validateEmail(normalise(req.body.email))) { return res.json({ error: 'user.account.changeEmail.invalid' }) }