|
|
|
@ -332,6 +332,11 @@ class UserLostPassHandler extends Handler {
|
|
|
|
|
if (!system.get('smtp.user')) throw new SystemError('Cannot send mail');
|
|
|
|
|
const udoc = await user.getByEmail('system', mail);
|
|
|
|
|
if (!udoc) throw new UserNotFoundError(mail);
|
|
|
|
|
await Promise.all([
|
|
|
|
|
this.limitRate('send_mail', 3600, 30, false),
|
|
|
|
|
this.limitRate(`user_lostpass_${mail}`, 60, 5, false),
|
|
|
|
|
oplog.log(this, 'user.lostpass', {}),
|
|
|
|
|
]);
|
|
|
|
|
const [tid] = await token.add(
|
|
|
|
|
token.TYPE_LOSTPASS,
|
|
|
|
|
system.get('session.unsaved_expire_seconds'),
|
|
|
|
|