Fix for #413 - support empty authData on signup

This commit is contained in:
Fosco Marotto
2016-02-26 05:05:15 -08:00
parent 791c5512aa
commit 1b83d9c621
2 changed files with 12 additions and 2 deletions

View File

@@ -1720,7 +1720,17 @@ describe('Parse.User testing', () => {
expect(e.code).toEqual(Parse.Error.SESSION_MISSING);
done();
});
})
});
it('support user/password signup with empty authData block', (done) => {
// The android SDK can send an empty authData object along with username and password.
Parse.User.signUp('artof', 'thedeal', { authData: {} }).then((user) => {
done();
}, (error) => {
fail('Signup should have succeeded.');
done();
});
});
});

View File

@@ -176,7 +176,7 @@ RestWrite.prototype.validateAuthData = function() {
}
}
if (!this.data.authData) {
if (!this.data.authData || !Object.keys(this.data.authData).length) {
return;
}