Skip to content

User has become invalid after parse server restarted #258

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

Closed
kosumi opened this issue Feb 5, 2016 · 4 comments
Closed

User has become invalid after parse server restarted #258

kosumi opened this issue Feb 5, 2016 · 4 comments
Labels
type:question Support or code-level question

Comments

@kosumi
Copy link

kosumi commented Feb 5, 2016

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.

@kosumi
Copy link
Author

kosumi commented Feb 5, 2016

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.

@gfosco
Copy link
Contributor

gfosco commented Feb 5, 2016

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.

@kosumi
Copy link
Author

kosumi commented Feb 6, 2016

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.

@gfosco
Copy link
Contributor

gfosco commented Feb 20, 2016

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.

@gfosco gfosco closed this as completed Feb 20, 2016
@mtrezza mtrezza added type:question Support or code-level question and removed 🔧 troubleshooting labels Jul 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:question Support or code-level question
Projects
None yet
Development

No branches or pull requests

3 participants