samedi 16 décembre 2017

Emberfire session not recognising any functions

I'm using emberfire to authenticate to a firebase database following the ember tutorial exactly with the following config:

//pods/application/route.js

  beforeModel: function() {
    return this.get("session").fetch().catch(function() {});
  },

  actions: {
    signIn: function(provider) {
      this.get('session').open('firebase', {
        provider: 'password',
        email: 'test@example.com',
        password: 'password1234'
      });
    },
    signOut: function() {
      this.get("session").close();
    }
  }



//app/torii-adapters/application.js
import ToriiFirebaseAdapter from 'emberfire/torii-adapters/firebase';
export default ToriiFirebaseAdapter.extend({
  firebase: Ember.inject.service()

});

"emberfire": "^2.0.8",
"torii": "^0.9.6"


//config/environment
    firebase: 'http://ift.tt/2kC83n1',
    torii: {
      sessionServiceName: 'session'
    },

I get the following error:

router.js:936 Error while processing route: index this.get(...).fetch is not a function TypeError: this.get(...).fetch is not a function

Does anybody have any idea what's going on? I'm copying the tutorial to the letter.




Aucun commentaire:

Enregistrer un commentaire