diff --git a/spec/ParseUser.spec.js b/spec/ParseUser.spec.js index 161e0cbd18..e93c6a015a 100644 --- a/spec/ParseUser.spec.js +++ b/spec/ParseUser.spec.js @@ -1028,6 +1028,23 @@ describe('Parse.User testing', () => { }); }); + it('returns authData when authed and logged in with provider (regression test for #1498)', done => { + Parse.Object.enableSingleInstance(); + let provider = getMockFacebookProvider(); + Parse.User._registerAuthenticationProvider(provider); + Parse.User._logInWith('facebook', { + success: user => { + let userQuery = new Parse.Query(Parse.User); + userQuery.get(user.id) + .then(user => { + expect(user.get('authData')).not.toBeUndefined(); + Parse.Object.disableSingleInstance(); + done(); + }); + } + }); + }); + it('log in with provider with files', done => { let provider = getMockFacebookProvider(); Parse.User._registerAuthenticationProvider(provider); @@ -2272,7 +2289,7 @@ describe('Parse.User testing', () => { } }); }); - + it('should not create extraneous session tokens', (done) => { let config = new Config(Parse.applicationId); config.database.loadSchema().then((s) => { diff --git a/src/Controllers/DatabaseController.js b/src/Controllers/DatabaseController.js index 8f6f4cf4c9..46c84174d6 100644 --- a/src/Controllers/DatabaseController.js +++ b/src/Controllers/DatabaseController.js @@ -112,13 +112,14 @@ DatabaseController.prototype.untransformObject = function( return object; } - delete object.authData; delete object.sessionToken; if (isMaster || (aclGroup.indexOf(object.objectId) > -1)) { return object; } + delete object.authData; + return object; };