我有很多麻烦,得到烬简单的奥斯与托里在所有的工作在目前使用ember。
在创建了一个新的Ember CLI应用程序并安装了torii,ember simple和ember auth-torii之后,我的登录页面上有了几个按钮。
下面是我的路由/login.js的内容:
import Ember from 'ember';
export default Ember.Route.extend({
actions: {
googleLogin: function() {
this.get('session').authenticate('simple-auth-authenticator:torii', 'google-oauth2');
return;
},
facebookLogin: function() {
this.get('session').authenticate('simple-auth-authenticator:torii', 'facebook-oauth2');
return;
}
}
});我的environment.js文件的相关部分是:
var ENV = {
...
torii: {
providers: {
'google-oauth2': {
apiKey: 'api-key-here',
scope: 'profile',
redirectUri: 'http://localhost:4200'
},
'facebook-oauth2': {
apiKey: 'api-key-here',
redirectUri: 'http://localhost:4200'
}
}
},
...
};当我按下login.js中的操作时,会得到以下错误:
Error: Expected configuration value providers.facebook-oauth2.apiKey to be defined!或
Error: Expected configuration value providers.google-oauth2.apiKey to be defined!为什么torii不选择我的environment.js配置?
发布于 2015-05-23 04:03:53
原来我的问题是一个简单的问题,余烬发球过程需要重新启动(Ctrl + c,然后重新运行成员服务)。
发布于 2015-05-22 18:42:55
您需要在facebook和google中创建应用程序,获取api键并将其放在上面写着:apiKey: 'api-key-here'在environment.js中的位置。
https://stackoverflow.com/questions/29876916
复制相似问题