mardi 25 septembre 2018

ReferenceError: Can't find variable: authenticator Ember js Error

I got an error ReferenceError: Can't find variable: authenticator Ember error in browser console and authenticator is not defined in terminal with this code

import Controller from '@ember/controller';
import { inject } from '@ember/service';
export default Controller.extend({
  session: inject('session'),
   actions: {   
     authenticate: function(){
       var credentials = this.getProperties('username','password');
       authenticator = 'authenticator:jwt';
       this.get('session').authenticate(authenticator,credentials).catch((reason) => {
            this.set('errorMessage', reason.error || reason);
       });
     }
}
});




Aucun commentaire:

Enregistrer un commentaire