I'm using the omniauth-facebook gem with devise to set up Facebook login on my website. I'm at the point of importing Facebook user data into my database, but I'm having some weird issues.
Here's my method used to import the data:
#User.rb
def self.from_omniauth(auth)
where(provider: auth.provider, uid: auth.uid).first_or_create do |member|
user.email = auth.info.email.to_s
user.password = Devise.friendly_token[0,20]
user.useame = auth.info.name
end
end
The record I get back has a useame equal to the Facebook email, and the email itself is nil. The "name" (which is actually the email address) is the only piece of Facebook user data I'm actually able to recover.
Has anyone else encountered this?
