Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloud Code: Allows user session creation with DIRECT_ACCESS #3156

Merged
merged 1 commit into from
Dec 6, 2016

Conversation

flovilmart
Copy link
Contributor

In an effort to remove the overhead of running cloud code with the HTTP interface, it's required to use the provided optional installationId.

For ex:

let user = new Parse.User();
user.save({username: "hello", password: "world"}).then((user) => {
     // the user has no Session
});
Parse.Cloud.define("signupUser", function(req, res) {
  let installationId = req.installationId; // installation Id passed by the client
  let user = new Parse.User();
  user.save({username: req.username, password: req.pass}, { installationId }).then((user) => {
    // the session token will be valid for that user!
    res.success(user.getSessionToken());
  });
});

@facebook-github-bot
Copy link

@flovilmart updated the pull request - view changes

@flovilmart flovilmart merged commit a906726 into master Dec 6, 2016
@flovilmart flovilmart deleted the directAccessInstallationId branch December 6, 2016 21:46
Jcarlosjunior pushed a commit to back4app/parse-server that referenced this pull request Dec 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants