diff --git a/lib/omniauth-tiktok-oauth2/version.rb b/lib/omniauth-tiktok-oauth2/version.rb index b4d7d3d..a8e1885 100644 --- a/lib/omniauth-tiktok-oauth2/version.rb +++ b/lib/omniauth-tiktok-oauth2/version.rb @@ -1,3 +1,3 @@ module OmniAuthTiktokOauth2 - VERSION = '0.1.4' + VERSION = '0.1.5' end diff --git a/lib/omniauth/strategies/tiktok_oauth2.rb b/lib/omniauth/strategies/tiktok_oauth2.rb index a88c037..4b14a11 100644 --- a/lib/omniauth/strategies/tiktok_oauth2.rb +++ b/lib/omniauth/strategies/tiktok_oauth2.rb @@ -1,8 +1,8 @@ require 'oauth2' require 'omniauth/strategies/oauth2' -OAuth2::Response.register_parser(:tiktok, ['application/json']) do |body| - JSON.parse(body)['data'] +OAuth2::Response.register_parser(:tiktok, []) do |body| + JSON.parse(body).fetch('data') rescue body end module OmniAuth