Skip to content

request.user.id fails in User afterSave #384

Description

@jiawenzhang

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

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

Activity

  1. thibauddavid commented on Feb 12, 2016

    @thibauddavid

    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

  2. drew-gross commented on Feb 12, 2016

    @drew-gross
    Contributor

    That is correct. Thanks for helping with the issues!

  3. jiawenzhang commented on Feb 28, 2016

    @jiawenzhang
    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.

  4. thibauddavid commented on Feb 28, 2016

    @thibauddavid

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

  5. jiawenzhang commented on Feb 28, 2016

    @jiawenzhang
    Author

    @Tibabal that works, thanks;

  6. parseplatformorg commented on Mar 1, 2024

    @parseplatformorg
    Contributor

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

  7. parseplatformorg commented on Mar 1, 2024

    @parseplatformorg
    Contributor

    🎉 This change has been released in version 6.5.0

  8. parseplatformorg commented on Mar 19, 2024

    @parseplatformorg
    Contributor

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

  9. parseplatformorg commented on Mar 19, 2024

    @parseplatformorg
    Contributor

    🎉 This change has been released in version 7.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions