Facebook OmniAuth 设计
我将 Rails 3 与 devise 和omniauth-facebook 一起使用,我单击“使用 facebook 链接登录”,它将我重定向到我的应用程序的 facebook 页面,我使用我的 facebook 凭据登录,它成功地将我重定向回我的 Rails 应用程序,并且它还将我的 Facebook 电子邮件添加到用户表中,但如何访问登录用户的详细信息?
我尝试使用设计用户模型,但
我
<%= link_to "Sign in with Facebook", user_omniauth_authorize_path(:facebook) %>
<% if user_signed_in? %>
<div>Signed in as... <%= current_user.email %></div>
<% else %>
not signed in
<% end %>
没有运气任何帮助将不胜感激,谢谢大家! :D
Im using rails 3 with devise and omniauth-facebook, I click on the "Login with facebook link", it redirects me to facebook page of my app, I login with my facebook credentials, it redirects me back to my Rails app successfully, and it also added my facebook email to the users table, but how do I access the logged in users details?
I tried using the devise user model, but no luck
here is what i have
<%= link_to "Sign in with Facebook", user_omniauth_authorize_path(:facebook) %>
<% if user_signed_in? %>
<div>Signed in as... <%= current_user.email %></div>
<% else %>
not signed in
<% end %>
Any help would be appreciated, thanks guys! :D
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我想你可以在这里找到你想要的东西,仔细阅读和观看这篇文章:)
http://railscasts.com/episodes/236-omniauth-part-2
I think here you can find what you're looking for, read and watch the article carefully :)
http://railscasts.com/episodes/236-omniauth-part-2
您可能还会发现 Koala Facebook gem 很方便。
You may also find the Koala Facebook gem handy.