I am complete beginner to Ember and jQuery. I am trying to implement a login page and I can't understand what should I return from the server side for the case of failed login. The code I have written until now is:
App.LoginController = Ember.Controller.extend({
loginFailed: false,
login: function() {
this.setProperties({
loginFailed: false
});
var request = $.post("/Login", this.getProperties("username", "password"));
request.then(this.success.bind(this), this.failure.bind(this));
},
success: function() {
// sign in logic
alert("Successful Login");
},
failure: function() {
this.set("loginFailed", true);
}
});
I have a login template and username and password are bound to inputs in the template. Currently, I am able to get the requests on the server side but I can't understand what should I return from server side for case of success and failure.