Login: display feedback.

This commit is contained in:
Matthew Dillon 2015-03-26 10:43:36 -08:00
parent 8e16295244
commit c5cb0ec145
6 changed files with 98 additions and 19 deletions

View file

@ -2,5 +2,20 @@ import Ember from 'ember';
import LoginControllerMixin from 'simple-auth/mixins/login-controller-mixin';
export default Ember.Controller.extend(LoginControllerMixin, {
authenticator: 'simple-auth-authenticator:jwt'
authenticator: 'simple-auth-authenticator:jwt',
loading: false,
actions: {
authenticate: function() {
this.set('errorMessage', null);
var _this = this;
this.set('loading', true);
this._super().then(function() {
_this.set('loading', false);
}, function(error) {
_this.set('loading', false);
var message = error.error;
_this.set('errorMessage', message);
});
}
}
});