Login: display feedback.
This commit is contained in:
parent
8e16295244
commit
c5cb0ec145
6 changed files with 98 additions and 19 deletions
|
@ -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);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Reference in a new issue