-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Clear sessions #403
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
Clear sessions #403
Conversation
fix bug when you try to change user password whit user.save(null, { useMasterKey: true }) cause Object not found error.
@flessard can you add Unit tests that will make sure we don't introduce regressions there at a later point? |
By trying to create a unit test i found the function Parse.User.become(sessionToken) always return object not found even if you pass a valid sessionToken. If you change this unit test «changing password clears sessions» by removing this line «newUser.set('password', 'facebook');», this test should be fail but this is not. |
That means the sessionToken is invalid right OR that there is a bug in
So the test should be:
|
Yes,
|
in src/Routers/UsersRouter.js:
And if we don't have a req.auth.user and querying /users/me, we should fail automatically to a User not found error or something like that as querying for /me does not make anysense when not logged in |
@flessard actually, that should return {"code":209,"error":"invalid session token"} |
If i try your fix, this unit-test |
@flessard there is a problem with the order of the query processing, the /user/me should be before /users/:objectId otherwise the route may not be taken properly. Check out that branch there: https://github.com/flovilmart/parse-server/tree/clear-sessions |
you can pull from mine or we replace the PR with the updated one. |
@flessard I've pushed another PR with the same changes as you and more tests. |
@flovilmart Nice thanks. |
you can close this one :) |
fix bug when you try to change user password whit user.save(null, {
useMasterKey: true }) cause Object not found error.