Skip to content

Commit

Permalink
Do not override application/json parser in OAuth2
Browse files Browse the repository at this point in the history
  • Loading branch information
kristofferek committed Apr 23, 2021
1 parent a9612d0 commit aeea13a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/omniauth-tiktok-oauth2/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module OmniAuthTiktokOauth2
VERSION = '0.1.4'
VERSION = '0.1.5'
end
4 changes: 2 additions & 2 deletions lib/omniauth/strategies/tiktok_oauth2.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit aeea13a

Please sign in to comment.