Skip to content

request.user is undefined after v2.1.4 #851

Closed
@tanmays

Description

@tanmays

Hello,

Ever since upgrading to 2.1.4, request.user is undefined in Cloud Code functions even after passing a valid session token. Prior to this release everything used to work well.

Here's an example:

Console log:

POST /parse/functions/GetBookmarks { host: '6115ba6a.ngrok.io',
  'content-type': 'application/json',
  'content-length': '0',
  'x-parse-session-token': 'r:<session-token-removed>',
  accept: '*/*',
  'user-agent': 'Pinglar/0.2 (iPhone; iOS 9.0.1; Scale/2.00)',
  'x-parse-application-id': 'xxx',
  'accept-language': 'en;q=1',
  'accept-encoding': 'gzip, deflate',
  'x-forwarded-proto': 'https',
  'x-forwarded-for': 'xxx.88.191.58' } {}
User is: undefined

Cloud Code:

Parse.Cloud.define("GetBookmarks", function(request, response) {

  var LinksSaved = Parse.Object.extend("LinksSaved");

  console.log("User is: " + JSON.stringify(request.user));

  var query = new Parse.Query(LinksSaved);
  query.equalTo("user", request.user);
  query.include("user");

  query.find({
      success: function(bookmarks) {
        response.success(bookmarks);
      },
      error: function(error) { // query error
        console.log("Unable to fetch bookmarks: "+ JSON.stringify(error));
        response.error(error);
      }
  });

});

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