Skip to content

Commit

Permalink
Fixes #1568 (#1574)
Browse files Browse the repository at this point in the history
  • Loading branch information
drew-gross authored and flovilmart committed Apr 20, 2016
1 parent 9776362 commit 7b91ee9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
19 changes: 18 additions & 1 deletion spec/ParseUser.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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) => {
Expand Down
3 changes: 2 additions & 1 deletion src/Controllers/DatabaseController.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down

0 comments on commit 7b91ee9

Please sign in to comment.