Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/omniauth/strategies/instagram.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,15 @@ def request_phase
'website' => raw_info['website'],
}
end

extra do
hash = {}
hash['raw_info'] = raw_info
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would just be returning {'raw_info': raw_info}

hash
end

def raw_info
@data ||= access_token.params["user"]
# @data ||= access_token.params["user"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this commented ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 year ago instagram return more data, when user authorised.
But now, it just return basic data, such name, nickname etc.
I need to know more info about user, such as followers count.
Method access_token.get('/v1/users/self') never been invoked, and I commented this code to fetch more info in "counts" hash key:

"data": {
"username": "pavel_galeta",
"bio": "",
"website": "",
"profile_picture": "https://instagramimages-a.akamaihd.net/profiles/anonymousUser.jpg",
"full_name": "pavel galeta",
"counts": {
"media": 79,
"followed_by": 56,
"follows": 53
},
"id": "31973911"
}

unless @data
access_token.options[:mode] = :query
access_token.options[:param_name] = "access_token"
Expand Down