Skip to content

Instantly share code, notes, and snippets.

@eavgerinos eavgerinos/user.rb Secret
Created Nov 28, 2012

What would you like to do?
def apply_omniauth(omniauth) = omniauth['info']['email'] if email.blank?
self.username = omniauth['info']['nickname'] if username.blank?
self.description = omniauth['info']['description'] if description.blank?
self.full_name = omniauth['info']['name'] if full_name.blank?
if omniauth['provider'] == "github"
self.github_link = omniauth['info']['urls']['GitHub']
self.github_username = omniauth['info']['name']
if omniauth['provider'] == "twitter"
self.twitter_link = omniauth['info']['urls']['Twitter']
self.twitter_username = omniauth['info']['nickname']
if omniauth['provider'] == "linkedin"
self.oauth_token_linkedin = omniauth['credentials']['token']
self.oauth_secret_linkedin = omniauth['credentials']['secret']
self.linkedin_email = omniauth['info']['email']
end omniauth['provider'], uid: omniauth['uid'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.