我的Ember应用会在用户通过身份验证后显示相关信息。我正在使用Firebase和正在验证的用户进行身份验证,但该路由似乎试图在此之前找到用户。它给了我这个错误:
Assertion Failed: You cannot pass `undefined` as id to the store's find method
任何想法如何解决这个/为什么会发生这种情况?
这是我的登录功能的应用程序路径:
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));
}
这是我的索引路线:
model: function(params){
return this.store.find('user', params.user_id);
}