Guest User

Untitled

a guest
Jan 24th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. def self.find_for_facebook_oauth(access_token, signed_in_resource=nil)
  2. data = access_token['extra']['user_hash']
  3. if user = User.find_by_email(data["email"])
  4. user
  5. else # Create a user with a stub password.
  6. User.create(:email => data["email"], :password => Devise.friendly_token[0,20])
  7. end
  8. end
Add Comment
Please, Sign In to add comment