Fix: Remove password reset token after successful reset (#248)

Signed-off-by: Knut Ahlers <knut@ahlers.me>

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers
2022-11-04 15:52:07 +01:00
committed by GitHub
parent 1109537675
commit d5cd829834

View File

@@ -289,7 +289,7 @@ router.post('/password_reset_requests/:confirm_token/confirm', function(req, res
bcrypt.genSalt(10, (err, salt) => { bcrypt.genSalt(10, (err, salt) => {
bcrypt.hash(password, salt, function(err, hash) { bcrypt.hash(password, salt, function(err, hash) {
user.password_hash = hash; user.password_hash = hash;
user.password_token = null; user.password_reset_token = null;
user.save().then(function(updatedUser) { user.save().then(function(updatedUser) {
res.sendStatus(201); res.sendStatus(201);
}); });