You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: