Analysis for javascript - "error 209 invalid session token" when registering a new user

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:

enter image description here

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.

+5
source share
1 answer

delete all of your session tokens and everything that is really related to Parse from local storage:

enter image description here

if necessary, disable obsolete session tokens and follow the tutorial on migration from scratch:

enter image description here

+15
source

All Articles