Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fixed client_id method not found bug #1

Merged
merged 2 commits into from

2 participants

holin he Scott Ballantyne
holin he

Hi there, I fixed a little bug, and now omniauth-taobao working too. :)

Scott Ballantyne ballantyne merged commit b379256 into from
Scott Ballantyne
Owner

thanks. i appreciate the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 17, 2011
  1. holin he
  2. holin he

    rm my info

    holin authored
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/omniauth/strategies/taobao.rb
7 lib/omniauth/strategies/taobao.rb
View
@@ -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
Something went wrong with that request. Please try again.