Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

request.user is "undefined" in the "beforeSave" function in the Cloud code #2929

Closed
grassland-curing-cfa opened this issue Oct 25, 2016 · 1 comment

Comments

@grassland-curing-cfa
Copy link

In my ParseServer migrated into the Heroko + mLab stack,

I have a beforeSave function set for a custom "OBSERVATION" Class as below.

Parse.Cloud.beforeSave("OBSERVATION", function(request, response) {
    ... ...
    var currUser = request.user;
    console.log(request);
    console.log("*** User objectId: " + currUser.id + "; " + currUser.getSessionToken());
    ... ...
});

I want to get the user name triggering the Save event. According to the Parse JavaScript SDK Reference, a "BeforeSaveRequest" takes a <Parse.User> as a member, which represents the User triggering the "Save" event.

However, this is always "undefined" for me. Is there anything I missed or did wrong?

@flovilmart
Copy link
Contributor

Can you please reopen the issue with the complete issue template filled?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants