fix password validate crash

This commit is contained in:
Mrugesh Mohapatra
2016-06-23 00:55:15 +05:30
parent 0ab01fc7d1
commit 546737e6be
2 changed files with 10 additions and 0 deletions

View File

@ -80,6 +80,11 @@ module.exports = function(User) {
if (user.progressTimestamps.length === 0) {
user.progressTimestamps.push({ timestamp: Date.now() });
}
// this is workaround for preventing a server crash
// refer strongloop/loopback/#1364
if (user.password === '') {
user.password = null;
}
}
return next();
});