Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parse.com: How do I return the session token?

I've created a signUp function for my app to call, and the Parse.com backend JS code to sign the user up.

Sure enough, the user will appear in the database. Heck, I even got the verification email to be sent (something that was much harder than it should be. It is a setting under the "settings" section of the main parse backend, not something that is programatically set).

Now I'm trying to get the sessionToken from the newly signed up user. Returning the "user" object on success of the signup and inspecting, I don't see a "sessionToken". I also don't see a sessionToken in the user database...

Can somebody give me some code that will return the 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 don't get a sessionToken here. Where do I get it from?

like image 973
bharal Avatar asked Dec 16 '12 15:12

bharal


People also ask

What is a parse server?

Parse Server is an open source backend that can be deployed to any infrastructure that can run Node. js. You can find the source on the GitHub repo. Parse Server uses MongoDB or PostgreSQL as a database. You can deploy and run Parse Server on your own infrastructure.

What is Parse API?

Parse is an open-source Android SDK and back-end solution that enables developers to build mobile apps with shared data quickly and without writing any back-end code or custom APIs. Parse is a Node.

What is parse dashboard?

Parse Dashboard is a standalone dashboard for managing your Parse apps. You can use it to manage your Parse Server apps. Overview of Parse Dashboard. Trademarks: This software listing is packaged by Bitnami.


1 Answers

I think you need to check on your local storage:

Local Storage Report

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

Parse/bqfSO3dVttG65a8CIkC1SdqC0CCqiqYsp1EfsjL8/currentUser

username [email protected]
email [email protected]
objectId oVGKr1vdbG
createdAt 2013-03-20T17:17:54.815Z
updatedAt 2013-03-20T17:17:54.815Z
_id oVGKr1vdbG
_sessionToken 12aob7us2lj18pkaddkbvsal7

That is what Parse checks when you do:

var currentUser = Parse.User.current();
var sessionToken = Parse.User.current()._sessionToken;
like image 93
Arcayne Avatar answered Sep 30 '22 19:09

Arcayne