ruby-on-railsfacebookfacebooker2

current_facebook_user always returns nil?


For some reason, this was working until some point in the last week, and just refuses to work anymore.

My app (http://melodizr.com) uses facebook connect to have users enter information in the database etc.

I am using facebooker2. The current_facebook_user function, however, keeps returning nil, even after login. If I browse the cookies in firefox, I can see that there is clearly a cookie set for the site and for the facebook connect portion, so I can't seem to understand the problem.

Here is the only code that uses facebook connect:

<% puts current_facebook_user.inspect %>
<%= fb_connect_async_js %>
<% if !current_facebook_user.nil? %>
  //do some stuff
<% else %>
  <div id="fbcont">
<%= fb_login_and_redirect "", :perms => '' %>
  </div>
<% end %>

Solution

  • Facebook has recently migrated all apps to OAuth 2.0. I had to update the Facebooker2 plugin for my app this week in order to use OAuth 2.0.

    See here for a summary: https://developers.facebook.com/docs/oauth2-https-migration/