Skip to content

Parse.FacebookUtils.Link from Cloud Code fails yet works on Parse.com #1464

Closed
@steven-supersolid

Description

@steven-supersolid

The following code will work on Parse.com with JS SDK 1.6.14, but not in a parse-server unit test:

it('respects useMasterKey when linking with Facebook', (done) => {
    var user = new Parse.User();
    user.setUsername('username');
    user.setPassword('password');
    user.set('attribute', 'value1');
    user.signUp().then((user) => {
      Parse.User.logOut();
      var authData = {
        id: "8675309",
        access_token: "jenny",
        expiration_date: new Date().toJSON()
      };
      return Parse.FacebookUtils.link(user, authData);
    }).then((user) => {
      done();
    }, (error) => {
      fail(error.message);
      done();
    });
  });

I'm not sure that this should work on Parse.com because it would enable one user to link another user's account.

I would expect the following code to work correctly in both cases but this will require a change to Parse-SDK-JS:

      return Parse.FacebookUtils.link(user, authData, {
        useMasterKey: true
      });

Just wanted to discuss here before creating an issue in the JS SDK and probably a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions