|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
var async = require('async');
|
|
|
|
|
|
|
|
|
|
var winston = require('winston');
|
|
|
|
|
|
|
|
|
|
var user = require('../user');
|
|
|
|
|
var topics = require('../topics');
|
|
|
|
@ -91,7 +91,17 @@ SocketUser.reset.send = function(socket, email, callback) {
|
|
|
|
|
return callback(new Error('[[error:invalid-data]]'));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
user.reset.send(email, callback);
|
|
|
|
|
user.reset.send(email, function(err) {
|
|
|
|
|
if (err && err.message !== '[[error:invalid-email]]') {
|
|
|
|
|
return callback(err);
|
|
|
|
|
}
|
|
|
|
|
if (err && err.message === '[[error:invalid-email]]') {
|
|
|
|
|
winston.verbose('[user/reset] Invalid email attempt: ' + email);
|
|
|
|
|
return setTimeout(callback, 2500);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
callback();
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
SocketUser.reset.commit = function(socket, data, callback) {
|
|
|
|
|