I am now implementing omniauth feature into my app. Everything works fine except that i cant get the first and last name from the facebook. Here is my model code.
After some fiddling around i found the solution. Now i think we have to explicitly require the fields we require. For me the fix is just to add first_name
and last_name
to facebook
.
In my initializers
i added first_name
and last_name
to info fields
.
info_fields: 'email, first_name, last_name'
Update
My full config file will look like this now
config.omniauth :facebook, ENV["FACEBOOK_APP_ID"], ENV["FACEBOOK_SECRET"], scope: 'email', info_fields: 'email, first_name, last_name'