|
|
@ -1001,10 +1001,7 @@ export default class RestAuthCtrl { |
|
|
|
const email = _email.toLowerCase(); |
|
|
|
const email = _email.toLowerCase(); |
|
|
|
|
|
|
|
|
|
|
|
const user = await this.users.where({ email }).first(); |
|
|
|
const user = await this.users.where({ email }).first(); |
|
|
|
if (!user) { |
|
|
|
if (user) { |
|
|
|
return next(new Error('This email is not registered with us.')); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const token = uuidv4(); |
|
|
|
const token = uuidv4(); |
|
|
|
await this.users |
|
|
|
await this.users |
|
|
|
.update({ |
|
|
|
.update({ |
|
|
@ -1038,8 +1035,8 @@ export default class RestAuthCtrl { |
|
|
|
description: `requested for password reset `, |
|
|
|
description: `requested for password reset `, |
|
|
|
ip: req.clientIp |
|
|
|
ip: req.clientIp |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
res.json({ msg: 'Check your email for password reset link.' }); |
|
|
|
res.json({ msg: 'Check your email if you are registered with us.' }); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected async tokenValidate(req, res, next): Promise<any> { |
|
|
|
protected async tokenValidate(req, res, next): Promise<any> { |
|
|
|