I wrote a simple function in an angularJS application to register new users:
$scope.registerUser = function(username, password) { var user = new Parse.User(); user.set("username", username); user.set("email", username); user.set("password", password); user.signUp(null, { success: function(result) { console.log(result); $scope.registerUserSuccess = true; $scope.registerUserError = false; $scope.registerUserSuccessMessage = "You have successfully registered!"; $scope.$apply(); $timeout(function(){ $state.go("user"); }, 1000); }, error: function(user, error) { $scope.registerUserError = true; $scope.registerUserSuccess = false; $scope.registerUserErrorMessage = "Error: [" + error.code + "] " + error.message; $scope.$apply(); } });
It initially worked fine, but when I deleted all users directly through Parse.com, I can no longer sign up for new users using this feature. Every time I get an error 209 invalid session token. Here is a screenshot of my Parse database:

I sent an error message to googled and the solution should always exit the current user. However, if there are no users, this is not an action that I can take.
Therefore, I would not only like to fix this problem, but I also know how to prevent it in the future so that my application can be used safely.
Edit: I created the user directly on Parse.com, wrote a function to log in to this user, but received the same error. I am completely stuck until the problem of this session is resolved.
source share