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.id fails in User afterSave #384

Closed
jiawenzhang opened this issue Feb 12, 2016 · 9 comments · Fixed by #8950
Closed

request.user.id fails in User afterSave #384

jiawenzhang opened this issue Feb 12, 2016 · 9 comments · Fixed by #8950
Labels
state:released Released as stable version state:released-alpha Released as alpha version state:released-beta Released as beta version

Comments

@jiawenzhang
Copy link

Parse.Cloud.afterSave(Parse.User, function(request) {

Parse.Cloud.useMasterKey();
var userId = request.user.id // this fails
...
})

@thibauddavid
Copy link

Hi @jiawenzhang, this is a known bug, see #373
By the way, you mustn't use Parse.Cloud.useMasterKey() anymore on parse-server, but {useMasterKey : true} along with each request you want to use it one, as specified here

@drew-gross
Copy link
Contributor

That is correct. Thanks for helping with the issues!

@jiawenzhang
Copy link
Author

this is not entirely fixed. if I am creating a new user, request.user.id still fails in afterSave, if it is an existing user, it works.

@thibauddavid
Copy link

You could use request.object.id in _User afterSave hook meanwhile

@jiawenzhang
Copy link
Author

@Tibabal that works, thanks;

@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 7.0.0-alpha.20

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label Mar 1, 2024
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 6.5.0

@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 7.0.0-beta.1

@parseplatformorg parseplatformorg added the state:released-beta Released as beta version label Mar 19, 2024
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 7.0.0

@parseplatformorg parseplatformorg added the state:released Released as stable version label Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:released Released as stable version state:released-alpha Released as alpha version state:released-beta Released as beta version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants