This commit is contained in:
Michael E. Gruen 2011-09-15 01:04:13 -04:00
Родитель 1512c2c6bf
Коммит 510c42069c
1 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -13,7 +13,7 @@ module OmniAuth
end end
def auth_hash def auth_hash
hash = user_info hash = user_info(@access_token)
OmniAuth::Utils.deep_merge( OmniAuth::Utils.deep_merge(
super, { super, {
@ -23,10 +23,10 @@ module OmniAuth
) )
end end
def user_info def user_info(access_token)
authenticated_user = MultiXml.parse(@access_token.get('/api/auth_user').body) authenticated_user = MultiXml.parse(access_token.get('/api/auth_user').body)
id = authenticated_user['GoodreadsResponse']['user']['id'].to_i id = authenticated_user['GoodreadsResponse']['user']['id'].to_i
response_doc = MultiXml.parse(@access_token.get("/user/show/#{id}.xml?key=#{@consumer_key}").body) response_doc = MultiXml.parse(access_token.get("/user/show/#{id}.xml?key=#{@consumer_key}").body)
user = response_doc['GoodreadsResponse']['user'] user = response_doc['GoodreadsResponse']['user']
hash = { hash = {