Skip to content

Instantly share code, notes, and snippets.

@dongalor
Created November 27, 2017 09:09
Show Gist options
  • Save dongalor/81348114f9256c567680138217b1a284 to your computer and use it in GitHub Desktop.
Save dongalor/81348114f9256c567680138217b1a284 to your computer and use it in GitHub Desktop.
Parse.Cloud.define('signIn', function (req, res) {
var email = req.params.email.toLowerCase();
Parse.User.logIn(email, req.params.password).then(function (user) {
res.success(user);
}, function (error) {
if (error.code === Parse.Error.INVALID_SESSION_TOKEN) {
Parse.User.logOut();
}
console.log("Error: " + error.code + " " + error.message);
res.error(error.message);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment