0

我正在使用 Jquery Mobile、Ruby on Rails 4 和 Omniauth-facebook。当我点击 Facebook 上的 Sing in 时,我会在控制台中看到这个:

omniauth: (facebook) Request phase initiated.

这被卡住了。我检查了浏览器控制台,它向我显示了这个错误:

XMLHttpRequest cannot load https://www.facebook.com/dialog/oauth?client_id..... No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access.

我在网上查过,很多人都面临这个问题。但是,我一直没有为rails找到一个全面的解决方案。请建议该怎么做。

4

1 回答 1

1

尝试为此链接禁用 Turbolinks:

<a href="..." data-no-turbolink>Sign in</a>
于 2015-04-30T00:05:22.867 回答