خرید بک لینک

Vote count: 0

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?

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: شنبه 9 مرداد 1395 ساعت: 8:27

صفحه بندی