diff options
author | Tor Andersson <tor@ccxvii.net> | 2022-08-15 12:19:47 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2022-08-28 21:37:06 +0200 |
commit | 659fef863dbb81f9e2cb35aad7bac5cc1d8ad6cf (patch) | |
tree | bbc651e3f9d6cb13257d7e27d75775312d018e09 | |
parent | 7dfe4ebbf43d16f8ecc36b8ec8100b840dd96148 (diff) | |
download | server-659fef863dbb81f9e2cb35aad7bac5cc1d8ad6cf.tar.gz |
Return after handling errors when changing mail address.
-rw-r--r-- | server.js | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -563,9 +563,9 @@ app.get('/change-mail', must_be_logged_in, function (req, res) { app.post('/change-mail', must_be_logged_in, function (req, res) { let newmail = req.body.newmail if (!is_email(newmail)) - res.render('change_mail.pug', { user: req.user, flash: "Invalid mail address!" }) + return res.render('change_mail.pug', { user: req.user, flash: "Invalid mail address!" }) if (SQL_EXISTS_USER_MAIL.get(newmail)) - res.render('change_mail.pug', { user: req.user, flash: "That mail address is already taken!" }) + return res.render('change_mail.pug', { user: req.user, flash: "That mail address is already taken!" }) SQL_UPDATE_USER_MAIL.run(newmail, req.user.user_id) return res.redirect('/profile') }) |