Skip to content

User has become invalid after parse server restarted #258

Closed

Description

@kosumi

I confirmed that the user which signed up via cloud code could access all cloud function and objects, even after it logged out and logged in again with renewing its session token.

But after restarting the parse server, all users seem to be invalid.
Though an user can log in the server and get a new session after the server restarted , the server responds "unauthorized" when the user calls any cloud code like "query.find".
(query.find fails in spite of being passed the new session token explicitly)

I cannot restart the server? or need any options?
Of course, this does not occur with Parse.com, although I don't know if Parse.com restarts or not.

Activity

  1. kosumi commented on Feb 5, 2016

    @kosumi
    Author

    Though I forgot to mention which API I used, it was REST API.
    Then I checked RestQuery.js.
    getUserAndRoleACL() seems only to get role and not to try to get the user.
    Is this the right way?
    Auth.js seems to get user from cache first. So, I think, my server could retrieve users info and their roles while there were users info in the cache. Then the user could execute cloud code.
    But after my server was restarted, there were no longer users info in cache, and RestQuery did not retrieve users info. Then the user could not execute cloud code.

  2. gfosco commented on Feb 5, 2016

    @gfosco
    Contributor

    getUserAndRoleACL fetches the array of roles, and then pushes the users objectId on to it. That looks correct.

    But this does sound like an issue.. will look in to it.

  3. kosumi commented on Feb 6, 2016

    @kosumi
    Author

    When there are no users in cache, user object is got by executing RestQuery.execute.
    getUserAndRoleACL() is called at first but there is no user object in auth at this time. Then roles are not retrieved.

  4. gfosco commented on Feb 20, 2016

    @gfosco
    Contributor

    Should be fixed by #374 which will be in 2.1.3, or you can pull the latest master. Please open a new issue if you still have problems. Thanks.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:questionSupport or code-level question

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions