0

我正在使用 rails 和 angular 来构建应用程序。我正在使用 satellizer 登录应用程序。

这是我的设计配置:

config.omniauth :facebook, "xxx1", "secret", :strategy_class => OmniAuth::Strategies::Facebook

在 JS 方面:

$authProvider.loginUrl = '/users/sign_in';
  $authProvider.facebook({clientId: 'xxx1', url: '/users/auth/facebook', type: '2.0'});

当我选择使用 fb 登录时,会出现一个弹出窗口,然后我进行身份验证,最后在弹出窗口关闭时出现此错误:

XMLHttpRequest cannot load https://graph.facebook.com/oauth/authorize?response_type=code&client_id=804…allback&state=c2131db90c6208181da224094bc2043ac43be5507bc2be8a&scope=email. A wildcard '*' cannot be used in the 'Access-Control-Allow-Origin' header when the credentials flag is true. Origin 'http://localhost:3000' is therefore not allowed access. 

你有什么主意吗?

提前致谢。

问候,

4

1 回答 1

1

您可以通过设置将其关闭凭据标志

$authProvider.withCredentials = false;

更多详情: https ://github.com/sahat/satellizer/releases/tag/0.9.1

于 2015-02-19T11:23:28.697 回答