Skip to content

Commit 717043f

Browse files
committed
use built-in json body parsing
1 parent a311097 commit 717043f

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lib/omniauth/strategies/fitbit_oauth2.rb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ def basic_auth_header
2828
end
2929

3030
def query_string
31-
'' # The state and code params shouldn't be sent as part of the callback_url in the callback phase
31+
# The state and code params shouldn't be sent as part of the
32+
# callback_url in the callback phase
33+
''
3234
end
3335

3436
uid do
@@ -61,12 +63,12 @@ def query_string
6163

6264
def raw_info
6365
if options[:use_english_measure] == 'true'
64-
@raw_info ||= MultiJson.load(access_token.
66+
@raw_info ||= access_token.
6567
request('get', 'https://api.fitbit.com/1/user/-/profile.json',
66-
{ 'Accept-Language' => 'en_US' }).body)
68+
{ 'Accept-Language' => 'en_US' }).parsed
6769
else
68-
@raw_info ||= MultiJson.load(access_token.
69-
get('https://api.fitbit.com/1/user/-/profile.json').body)
70+
@raw_info ||= access_token.
71+
get('https://api.fitbit.com/1/user/-/profile.json').parsed
7072
end
7173
end
7274
end

0 commit comments

Comments
 (0)