Skip to content

Commit 1b83d9c

Browse files
committed
Fix for #413 - support empty authData on signup
1 parent 791c551 commit 1b83d9c

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

spec/ParseUser.spec.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1720,7 +1720,17 @@ describe('Parse.User testing', () => {
17201720
expect(e.code).toEqual(Parse.Error.SESSION_MISSING);
17211721
done();
17221722
});
1723-
})
1723+
});
1724+
1725+
it('support user/password signup with empty authData block', (done) => {
1726+
// The android SDK can send an empty authData object along with username and password.
1727+
Parse.User.signUp('artof', 'thedeal', { authData: {} }).then((user) => {
1728+
done();
1729+
}, (error) => {
1730+
fail('Signup should have succeeded.');
1731+
done();
1732+
});
1733+
});
17241734

17251735
});
17261736

src/RestWrite.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ RestWrite.prototype.validateAuthData = function() {
176176
}
177177
}
178178

179-
if (!this.data.authData) {
179+
if (!this.data.authData || !Object.keys(this.data.authData).length) {
180180
return;
181181
}
182182

0 commit comments

Comments
 (0)