mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-30 02:25:55 +01:00
change isPasswordCorrect to return false if user does not have password
This commit is contained in:
@@ -37,6 +37,12 @@ SocketUser.deleteAccount = function (socket, data, callback) {
|
||||
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
user.hasPassword(socket.uid, next);
|
||||
},
|
||||
function (hasPassword, next) {
|
||||
if (!hasPassword) {
|
||||
return next();
|
||||
}
|
||||
user.isPasswordCorrect(socket.uid, data.password, socket.ip, function (err, ok) {
|
||||
next(err || (!ok ? new Error('[[error:invalid-password]]') : undefined));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user