Parse.com: How to return a session token?

I created the signUp function for my application to call and the Parse.com JS code for the user signature.

Of course, the user will appear in the database. Hell, I even received a sent letter for verification (which was much more complicated than it should be). This is a parameter in the Settings section of the main parsing backend, not something that is automatically programmed).

Now I'm trying to get sessionToken from a newly registered user. Returning the "user" object to the success of registration and verification, I do not see the "sessionToken". I also do not see sessionToken in the user database ...

Can someone give me a code that will return sessionToken?

Here is the relevant code:

user.signUp(null, { success: function(user) { response.success(user); }, error: function(user, error) { alert("Error: " + error.code + " " + error.message); } }); 

I do not get sessionToken here. Where do I get this from?

+6
source share
2 answers

The code I used looked something like this:

 endpoint : "https://api.parse.com/1/login", parameters : getTheLoginParametersFrom(user), success : function(response) { tablesModule.saveSessionId(response.sessionToken); } } 

If the result of the "login" is the response .sessionToken.

0
source

I think you need to check local storage:

Local repository report

There are 5 items in local storage using 0.9KB (0.001MB)

Analyze / bqfSO3dVttG65a8CIkC1SdqC0CCqiqYsp1EfsjL8 / CurrentUser

username XXX@gmail.com
email XXX@gmail.com
objectId oVGKr1vdbG
createdAt 2013-03-20T17: 17: 54.815Z
updatedAt 2013-03-20T17: 17: 54.815Z
_id oVGKr1vdbG
_sessionToken 12aob7us2lj18pkaddkbvsal7

This is what Parse checks when you do:

 var currentUser = Parse.User.current(); var sessionToken = Parse.User.current()._sessionToken; 
+6
source

All Articles