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.
From checking the Facebook docs, the first_name
and last_name
fields are both part of the public profile so your permissions should be fine.
No idea if this would work (in fact, I would kind of hope it doesn't), but in the implementation we've got working in production at the moment we're using Hash accessors instead of methods. So:
new(
first_name: oauth_data["info"]["first_name"],
last_name: oauth_data["info"]["last_name"],
...
Given your email
etc fields are getting set correctly, I'd be surprised if trying that works, but it might be worth a shot.
Failing that, have you got any validations or before_create
callbacks which could be interfering somehow?