mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-27 06:52:35 -04:00
[user][bug] validate NEW email, not the old one 🤦
This commit is contained in:
parent
8428ee8e46
commit
e7e970f847
@ -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' })
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user