Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Catch JSON parsing errors in OAuth strategies. Closes #158

  • Loading branch information...
commit 99d0faded7dcde6e3babce4704cfd777fd73bc6e 1 parent 61e64c3
@mbleigh mbleigh authored
View
2  oa-oauth/lib/omniauth/strategies/oauth.rb
@@ -48,6 +48,8 @@ def callback_phase
super
rescue ::OAuth::Unauthorized => e
fail!(:invalid_credentials, e)
+ rescue ::MultiJson::DecodeError => e
+ fail!(:invalid_response, e)
end
def auth_hash
View
2  oa-oauth/lib/omniauth/strategies/oauth2.rb
@@ -79,6 +79,8 @@ def callback_phase
super
rescue ::OAuth2::HTTPError, ::OAuth2::AccessDenied, CallbackError => e
fail!(:invalid_credentials, e)
+ rescue ::MultiJson::DecodeError => e
+ fail!(:invalid_response, e)
end
def auth_hash

1 comment on commit 99d0fad

@dcrockwell

Hello. I believe this commit introduced a bug in that the gemspec here: https://github.com/intridea/omniauth/blob/master/oa-oauth/oa-oauth.gemspec is requiring multi_json v.0.0.2 which as you can see here: https://github.com/intridea/multi_json/tree/v0.0.2 does not support the MultiJson::DecodeError object which is not available until this commit in v.0.0.5: intridea/multi_json@dea9a1a

Please sign in to comment.
Something went wrong with that request. Please try again.