Rails 3:Omniauth-Facebook:不会在弹出窗口中加载
我正在使用omniauth-facebook 来处理Facebook 身份验证,它运行得非常好。然而,在弹出窗口中打开 Facebook 对话框(在文档中看起来非常简单)对我来说不起作用。
devise.rb:
require "omniauth-facebook"
config.omniauth :facebook, "xxx", "yyy", { :scope => 'publish_stream,publish_actions,email,read_stream,offline_access', :display => 'popup' }
但是,它没有在弹出窗口中加载。相反,它会转移到 facebook.com,然后再返回。也就是说,加载的 URL 包含“display=popup”,因此代码可以正确读取,只是没有在模式中加载。
这感觉像是 Javascript 问题吗?我不确定 Omniauth 使用什么来处理模态/iframe/等。在这起作用之前我应该包含一些东西吗?
提前致谢!
I am using omniauth-facebook to handle Facebook auth, and it's working wonderfully. However, opening the facebook dialogs in a popup, which appear quite simple in the documentation, isn't working for me.
devise.rb:
require "omniauth-facebook"
config.omniauth :facebook, "xxx", "yyy", { :scope => 'publish_stream,publish_actions,email,read_stream,offline_access', :display => 'popup' }
However, it's not loading in a popup. Rather, it's moving over to facebook.com and then back. That said, the URL that loads includes "display=popup", so the code is being read properly, it's just not loading in a modal.
This feels like a Javascript issue? I am not sure what Omniauth uses to handle modals / iframes / etc. Is there something I should be including before this will work?
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
经过数小时的研究和反复试验,我找到了一个可行的解决方案。我觉得必须有一个更加集成的解决方案,但我不知道。
这个 jQuery 将触发当前上方的 fb auth 窗口:
在您的回调页面上:(
或者您希望在父页面上发生的任何情况)
After hours and hours of research and trial and error, I found a solution that works. I feel like there must be a more integration solution, but I don't know it.
This jQuery will trigger the fb auth window above the current:
And on your callback page:
(or whatever you want to happen to the parent page)