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
|
* @returns
|
||||||
*/
|
*/
|
||||||
async function resetPassword(password, secret) {
|
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) {
|
if (!request) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -46,6 +46,7 @@ async function resetPassword(password, secret) {
|
||||||
password
|
password
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Delete all the requests associated with that e-mail
|
||||||
await tr('RequestResetPassword').where({
|
await tr('RequestResetPassword').where({
|
||||||
email
|
email
|
||||||
}).del();
|
}).del();
|
||||||
|
|
Loading…
Reference in New Issue