mirror of https://github.com/xfarrow/blink
Update reset_password_model.js
This commit is contained in:
parent
dbdc9f78c5
commit
84a7290ebc
|
@ -35,7 +35,7 @@ async function findBySecret(secret) {
|
|||
* @returns
|
||||
*/
|
||||
async function resetPassword(password, secret) {
|
||||
const request = await findBySecret(secret);
|
||||
const request = await findBySecret(secret); //TODO should we avoid another db call by directly passing the email?
|
||||
if (!request) {
|
||||
return;
|
||||
}
|
||||
|
@ -46,6 +46,7 @@ async function resetPassword(password, secret) {
|
|||
password
|
||||
});
|
||||
|
||||
// Delete all the requests associated with that e-mail
|
||||
await tr('RequestResetPassword').where({
|
||||
email
|
||||
}).del();
|
||||
|
|
Loading…
Reference in New Issue