Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #1 from holin/master

Fixed client_id method not found bug
  • Loading branch information...
commit b379256691d038347612fd1dcb599a4cab882095 2 parents d07bbe3 + 7581d2e
@ballantyne authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/omniauth/strategies/taobao.rb
View
7 lib/omniauth/strategies/taobao.rb
@@ -12,12 +12,13 @@ def request_phase
super
end
-
uid { raw_info['uid'] }
info do
{
'uid' => raw_info['uid'],
+ 'nickname' => raw_info['nick'],
+ 'email' => raw_info['email'],
'user_info' => raw_info,
'extra' => {
'user_hash' => raw_info,
@@ -29,7 +30,7 @@ def raw_info
url = 'http://gw.api.taobao.com/router/rest'
query_param = {
- :app_key => client_id,
+ :app_key => options.client_id,
# TODO to be moved in options
# TODO add more default fields (http://my.open.taobao.com/apidoc/index.htm#categoryId:1-dataStructId:3)
@@ -50,7 +51,7 @@ def raw_info
def generate_sign(params)
# params.sort.collect { |k, v| "#{k}#{v}" }
- str = client_secret + params.sort {|a,b| "#{a[0]}"<=>"#{b[0]}"}.flatten.join + client_secret
+ str = options.client_secret + params.sort {|a,b| "#{a[0]}"<=>"#{b[0]}"}.flatten.join + options.client_secret
params['sign'] = Digest::MD5.hexdigest(str).upcase!
params
end
Please sign in to comment.
Something went wrong with that request. Please try again.