summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-12-21 14:12:36 +0100
committerTor Andersson <tor@ccxvii.net>2023-01-31 12:39:03 +0100
commit61fc6ea9dcdcbf5454ad85cae32120c9d5d4c8b4 (patch)
tree29e5fd3833537df598a85dc25f2477a0b74627db
parent00916460c8261473b2afce60853c406f10aee6c0 (diff)
downloadserver-61fc6ea9dcdcbf5454ad85cae32120c9d5d4c8b4.tar.gz
Oops. Fix change password bug.
-rw-r--r--server.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/server.js b/server.js
index 8ba605f..380e14d 100644
--- a/server.js
+++ b/server.js
@@ -537,6 +537,7 @@ app.post('/change-password', must_be_logged_in, function (req, res) {
return res.render('change_password.pug', { user: req.user, flash: "Wrong password!" })
let salt = crypto.randomBytes(32).toString('hex')
let hash = hash_password(newpass, salt)
+ SQL_UPDATE_USER_PASSWORD.run(hash, salt, user.user_id)
return res.redirect('/profile')
})