api: Consider password reset a successful email verification (fixes #77)

This commit is contained in:
Paul Bienkowski 2021-05-15 10:21:26 +02:00
parent 54d0a56b9a
commit fb1d04d98e

View file

@ -93,6 +93,12 @@ async function resetPassword({ token, password }) {
// update password and remove reset token // update password and remove reset token
account.setPassword(password); account.setPassword(password);
account.resetToken = undefined; account.resetToken = undefined;
// Since password recovery happens through email, we can consider this a
// successful verification of the email address.
account.needsEmailValidation = false;
account.verificationToken = undefined;
await account.save(); await account.save();
} }