mirror of
https://github.com/xfarrow/blink
synced 2025-04-15 16:57:19 +02:00
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…
x
Reference in New Issue
Block a user