0

My Ember app will show user's information after they are authenticated. I am doing authentication with Firebase and the user the is being authenticated, but the route seems to trying to find the user before this happens. It gives me this error:

Assertion Failed: You cannot pass `undefined` as id to the store's find method

Any idea how to fix this/ why it is happening?

Here is my application route with the login function:

login: function(email, password) {
           this.get('session').open('firebase', {
                provider: 'password',
                email: email,
                password: password
           }).then(function() {
               this.transitionTo('index');
           }.bind(this));
       },
       logout: function() {
           this.get('session').close().then(function() {
               this.transitionTo('application');
           }.bind(this));
       }

Here is my index route:

  model: function(params){
        return this.store.find('user', params.user_id);
}
4

0 に答える 0