OmniAuth Facebook 作为弹出窗口
我正在尝试遵循此解决方案,将 Facebook 显示为具有omniauth 的弹出窗口:
但是答案指出:
然后在您的回调视图中:
:javascript
if(window.opener) {
window.opener.location.reload(true);
window.close()
}
我已经遵循了简单的omniauth的railscast。我只使用脸书。我在初始化程序中设置了 :display=>popup 。但是,我没有回调视图,只有会话控制器和创建操作。如何使用回调视图以便放入此代码?
I'm trying to follow along with this solution for displaying Facebook as a popup with omniauth:
Turn omniauth facebook login into a popup
However the Answer states:
And then in your callback view:
:javascript
if(window.opener) {
window.opener.location.reload(true);
window.close()
}
I have followed the railscast for simple omniauth. I'm only using facebook. I have set :display=>popup in my initializer. However, I don't have a callback view, only a session controller and a create action. How can I use a view for the callback so I can put this code in?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在您的 routes.rb 文件中,您必须使用 OmniAuth 指定回调,如下所示:
您可以在您的 UsersController 类中返回您的操作/方法:
并在中创建其视图文件观点 -> 用户 -> share.html.erb
如果您更喜欢使用该模板,则可以使用不同的布局。
In your routes.rb file you must have specified callback with OmniAuth like this:
Where You can have your action/method back in your UsersController class :
and create its view file in views -> users -> share.html.erb
And you may have a different layout for this template if, you prefer to use one.