Closed nafplann closed 5 years ago
Hi. If that error is from Parse, that would mean that the session token you are using is lost in the way somehow? I don't know why would that happen. If you could post the exception message and backtrace maybe we could know the reason.
About useMasterKey in the signUp method, we can't signUp users using master key, that isn't supported by the Parse PHP SDK. Here's Parse's signUp method.
after deleting a user, when I check Parse\ParseUser::getCurrentUser() my session is replaced by the deleted user session
I think I found it. When adding users it seems we use signUp method instead of save method right? thats when the sessiontoken gets overwritten
Ooh, that makes sense. Checking the signUp()
method linked above, we can see that it calls handleSaveResult(true)
, which makes the new user the current user because of that true
value. The signUp()
method only makes some checks before calling parent::save()
, so creating a new user takes nothing more than a save()
call. Maybe you could do that: instead of creating users with signUp()
, call save()
.
Thanks for the help. I ended up create a new model extending ObjectModel instead of UserModel to make it work the way I need.
I'll close this.
Hi again. I have admin panel where I can add, edit, remove users. The problem is after I delete some user records then i try to add a new one it throws invalid session token errors.
I think its because this library doesn't have the option to useMasterKey on userModel signUp method. Do you have any suggestions?