I'm trying to handle an error messages with Ember Simple Auth, I'm using the devise extension.
File: app/controllers/login.js
import Ember from 'ember';
import LoginControllerMixin from 'simple-auth/mixins/login-controller-mixin';
export default Ember.Controller.extend(LoginControllerMixin, {
authenticator: 'simple-auth-authenticator:devise',
identification: null,
password: null,
loginError: false,
isSubmitting: false,
actions: {
authenticate: function() {
var data = this.getProperties('identification', 'password');
this._super(data);
this.set('password', null);
this.setProperties({
loginError: true,
loginResponse: 'login error'
});
}
}
});
At the moment I always get the error message. I don't know how to show it only when an error occur. I have tried with
this._super(data).then(function({
// Error handler
});
But then I get the error "_super() is undefined".