Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Commit

Permalink
update provdiers/vk.py with merged in changes
Browse files Browse the repository at this point in the history
  • Loading branch information
eriktaubeneck committed Jul 10, 2014
1 parent c2582a5 commit 36f5790
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions flask_social/providers/vk.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
'request_token_url': None,
'access_token_url': 'https://oauth.vk.com/access_token',
'authorize_url': 'https://oauth.vk.com/authorize',
'request_token_params': {}
}


Expand All @@ -42,7 +41,7 @@ def get_connection_values(response, **kwargs):
return None

access_token = response['access_token']
vk = vkontakte.API(token=response['access_token'])
vk = vkontakte.API(token=access_token)
profile = vk.getProfiles(
uids=response['user_id'],
fields='first_name,last_name,photo_100,screen_name')[0]
Expand All @@ -57,5 +56,13 @@ def get_connection_values(response, **kwargs):
display_name=profile.get('screen_name', fullname),
full_name=fullname,
profile_url=profile_url,
image_url=profile.get('photo_100')
image_url=profile.get('photo_100'),
email='',
)


def get_token_pair_from_response(response):
return dict(
access_token=response.get('access_token', None),
secret=None,
)

0 comments on commit 36f5790

Please sign in to comment.