This commit is contained in:
Julian Lam
2018-07-27 11:54:23 -04:00
parent b3f5901a96
commit b6a5419ca1
6 changed files with 32 additions and 36 deletions

View File

@@ -37,8 +37,8 @@ SocketUser.deleteAccount = function (socket, data, callback) {
async.waterfall([
function (next) {
user.isPasswordCorrect(socket.uid, data.password, function (err, ok) {
next(err || !ok ? new Error('[[error:invalid-password]]') : undefined);
user.isPasswordCorrect(socket.uid, data.password, socket.ip, function (err, ok) {
next(err || (!ok ? new Error('[[error:invalid-password]]') : undefined));
});
},
function (next) {
@@ -61,15 +61,7 @@ SocketUser.deleteAccount = function (socket, data, callback) {
});
next();
},
], function (err) {
if (err) {
return setTimeout(function () {
callback(err);
}, 2500);
}
callback();
});
], callback);
};
SocketUser.emailExists = function (socket, data, callback) {