I am using the oauth gem to authenticate users through GitHub. I'm trying to get the person's username and avatar url. I can't find, or completely missed, where in the scopes I can get access to these things. This is from my user model and my initializer file:
# omniauth.rb
scope: "user, public_repo, repo"
# user.rb
def self.create_with_omniauth(auth)
create! do |user|
user.provider = auth["provider"]
user.uid = auth["uid"]
user.name = auth["info"]["name"]
user.email = auth["info"]["email"]
end
end
I have tried guessing what might get the username and avatar url with:
user.username = auth["info"]["login"]
user.avatar = auth["info"]["avatar_url"]