Skip to content
Browse files

Raise Error for Taobao OAuth error

  • Loading branch information...
1 parent b379256 commit fca14287760fab28ab4b5629bea96cec864cbd58 @hisea hisea committed
Showing with 5 additions and 3 deletions.
  1. +3 −1 lib/omniauth/strategies/taobao.rb
  2. +2 −2 omniauth-taobao.gemspec
View
4 lib/omniauth/strategies/taobao.rb
@@ -44,7 +44,9 @@ def raw_info
}
query_param = generate_sign(query_param)
res = Net::HTTP.post_form(URI.parse(url), query_param)
- @raw_info ||= MultiJson.decode(res.body)['user_get_response']['user']
+ response = MultiJson.decode(res.body)
+ raise OmniAuth::Error.new(response['error_response']) if response.has_key?('error_response')
+ @raw_info ||= response['user_get_response']['user']
rescue ::Errno::ETIMEDOUT
raise ::Timeout::Error
end
View
4 omniauth-taobao.gemspec
@@ -12,8 +12,8 @@ Gem::Specification.new do |s|
s.description = %q{an omniauth strategy for taobao}
s.rubyforge_project = "omniauth-taobao"
- s.add_dependency 'omniauth', '~> 1.0.0.rc2'
- s.add_dependency 'omniauth-oauth2', '~> 1.0.0.rc2'
+ s.add_dependency 'omniauth', '~> 1.1.4'
+ s.add_dependency 'omniauth-oauth2', '~> 1.1.1'
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")

0 comments on commit fca1428

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