Closed dcalixto closed 1 year ago
Hello i'm trying to get the facebook first name to put on username on omniauth-facebook gem
but just get the name, looking at facebook docs indeed has first_name but how to get it?
here is the code
def self.from_omniauth(access_token) data = access_token.info user = User.where(email: data['email']).first user ||= User.create(name: data['name'], email: data['email'], username: data['first_name'], avatar_url: data['image'], provider: access_token['provider'], uid: access_token['uid'], password: Devise.friendly_token[0, 20]) user end
i tried the info_fields but did not worked
config.omniauth :facebook, '', '', scope: 'email', info_fields: 'first_name'
so someone can help?
ok, fixed, just forget to restart the server!
Hello i'm trying to get the facebook first name to put on username on omniauth-facebook gem
but just get the name, looking at facebook docs indeed has first_name but how to get it?
here is the code
i tried the info_fields but did not worked
so someone can help?