don't serve null authData values (#2320)

This commit is contained in:
Dan Huang
2016-07-18 23:00:16 -07:00
committed by Drew
parent 025482ea1a
commit c81f48aae6
2 changed files with 32 additions and 0 deletions

View File

@@ -394,6 +394,17 @@ RestQuery.prototype.runFind = function() {
if (this.className === '_User') {
for (var result of results) {
delete result.password;
if (result.authData) {
Object.keys(result.authData).forEach((provider) => {
if (result.authData[provider] === null) {
delete result.authData[provider];
}
});
if (Object.keys(result.authData).length == 0) {
delete result.authData;
}
}
}
}