Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix client_id method not found bug

  • Loading branch information...
commit cf37207d569a8d4010eee724aa24bb1da65678a5 1 parent d07bbe3
@holin authored
Showing with 8 additions and 3 deletions.
  1. +8 −3 lib/omniauth/strategies/taobao.rb
View
11 lib/omniauth/strategies/taobao.rb
@@ -11,13 +11,18 @@ def request_phase
options[:state] ||= '1'
super
end
-
+
+ # def callback_url
+ # "http://www.zuiyouji.com:3000" + script_name + callback_path
+ # 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 +34,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 +55,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.