Fix for #413 - support empty authData on signup
This commit is contained in:
@@ -1720,7 +1720,17 @@ describe('Parse.User testing', () => {
|
|||||||
expect(e.code).toEqual(Parse.Error.SESSION_MISSING);
|
expect(e.code).toEqual(Parse.Error.SESSION_MISSING);
|
||||||
done();
|
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();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ RestWrite.prototype.validateAuthData = function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.data.authData) {
|
if (!this.data.authData || !Object.keys(this.data.authData).length) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user