Closed
Description
Parse.Cloud.define('adminLogin', function(request, response) {
var username = request.params.username;
var password = request.params.password;
var emailPattern = request.params.emailPattern;
var admin = false;
Parse.User.logIn(username, password, {
if (username.equals("EMAIL_ADDRESS_HERE")) {
admin = true;
}
success: function(user) {
// Do stuff after successful login.
},
error: function(user, error) {
// The login failed. Check error to see why.
}
});
});
So, basically, what I want to happen is if a certain user tries to sign in, itll log in. For example, if I login with my email address and password, itll work.... however, if its anything OTHER than me, it fails....
I can easily do this inside of the application, but how is something like that done in cloud code?
I figure, if I put the code inside of success, then itll work regardless, and I dont want that. I want my cloudcode to determine if its me, if it is, were successful, if its not, we fail.
Metadata
Metadata
Assignees
Labels
No labels