mirror of
https://github.com/omniauth/omniauth.git
synced 2022-11-09 12:31:49 -05:00
Merge pull request #302 from heydiplo/master.
vkontakte empty response handling
This commit is contained in:
commit
ac27772dfd
1 changed files with 2 additions and 2 deletions
|
@ -36,10 +36,10 @@ module OmniAuth
|
|||
|
||||
# we need these 2 additional requests since vkontakte returns only ids of the City and Country
|
||||
# http://vkontakte.ru/developers.php?o=-17680044&p=getCities
|
||||
@city ||= MultiJson.decode(@access_token.get("https://api.vkontakte.ru/method/getCities?cids=#{@data['city']}&access_token=#{@access_token.token}"))['response'][0]['name']
|
||||
@city ||= MultiJson.decode(@access_token.get("https://api.vkontakte.ru/method/getCities?cids=#{@data['city']}&access_token=#{@access_token.token}"))['response'].try(:[], 0).try(:[], 'name')
|
||||
|
||||
# http://vkontakte.ru/developers.php?o=-17680044&p=getCountries
|
||||
@country ||= MultiJson.decode(@access_token.get("https://api.vkontakte.ru/method/getCountries?cids=#{@data['country']}&access_token=#{@access_token}"))['response'][0]['name']
|
||||
@country ||= MultiJson.decode(@access_token.get("https://api.vkontakte.ru/method/getCountries?cids=#{@data['country']}&access_token=#{@access_token}"))['response'].try(:[], 0).try(:[], 'name')
|
||||
end
|
||||
|
||||
def request_phase
|
||||
|
|
Loading…
Reference in a new issue