Can't get the current user in cloud code

Why I can’t get the current user in my cloud code? Even though I pass a header X-Parse-Session-Token, user is still {}

Cloud code:

Parse.Cloud.define('hello', req => {
 return req.user; // => {}
});

or

Parse.Cloud.define('hello', (request) => {
 return request.user; // doesnt work either
});

Parse-Server package.json dep:

  "dependencies": {
    "express": "4.17.1",
    "kerberos": "1.1.4",
    "parse": "3.4.3",
    "parse-server": "5.2.4"
  },

After how many months of being stucked in this problem.
Finally! I figured it out.

I just need to **remove the header: ** X-Parse-Master-Key and replace it with X-Parse-REST-API-Key

Ohh my gawwd!

I believe all you need to get the rest api working is the app id. To make Parse more secure, I’ve totally removed any reference of the master key in my headers (no matter what the header is called).

I’ve got one app in production and another in development and I’ve not yet had any hiccups removing it. Having the key that can override all the class perms/acls exposed is a bit nerve-wracking :slight_smile:

If you’ve found a reason to keep the key in the headers, please do share.