summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-01-02 13:04:35 +0100
committerTor Andersson <tor@ccxvii.net>2024-01-02 13:04:35 +0100
commit42be5936901defc8f1850c650c033dcff8ee510c (patch)
tree002ce8dedf77c84e0d05211d741e5588edf0253c
parenta5000cc521686c9ff975a0548934f7b9aa8a378d (diff)
downloadserver-42be5936901defc8f1850c650c033dcff8ee510c.tar.gz
Check forbidden mail list when changing mail address.
-rw-r--r--server.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/server.js b/server.js
index edb9d5f..8130397 100644
--- a/server.js
+++ b/server.js
@@ -657,7 +657,7 @@ 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_valid_email(newmail))
+ if (!is_valid_email(newmail) || is_forbidden_mail(newmail))
return res.render("change_mail.pug", { user: req.user, flash: "Invalid mail address!" })
if (SQL_EXISTS_USER_MAIL.get(newmail))
return res.render("change_mail.pug", { user: req.user, flash: "That mail address is already taken!" })