From 2cd88342e31f54b38adc986992da37be558916ea Mon Sep 17 00:00:00 2001 From: p31729568 Date: Mon, 4 Nov 2019 17:54:39 +0800 Subject: [PATCH] qq oauth --- app/libs/omniauth/strategies/qq.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/libs/omniauth/strategies/qq.rb b/app/libs/omniauth/strategies/qq.rb index 513257e3c..885970bad 100644 --- a/app/libs/omniauth/strategies/qq.rb +++ b/app/libs/omniauth/strategies/qq.rb @@ -37,13 +37,16 @@ module OmniAuth def raw_info access_token.options[:mode] = :query - @raw_info ||= access_token.get('/oauth2.0/me').parsed + @raw_info ||= begin + res = access_token.get('/oauth2.0/me') + JSON.parse(res.body.to_s[10..-4]) + end end def user_info access_token.options[:mode] = :query params = { oauth_consumer_key: options.client_id, openid: raw_info['openid'], format: 'json' } - @user_info ||= access_token.get('/user/get_user_info', params: params) + @user_info ||= access_token.get('/user/get_user_info', params: params).parsed end end end