Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fix client_id method not found bug

  • Loading branch information...
commit cf37207d569a8d4010eee724aa24bb1da65678a5 1 parent d07bbe3
holin holin authored

Showing 1 changed file with 8 additions and 3 deletions. Show diff stats Hide diff stats

  1. +8 3 lib/omniauth/strategies/taobao.rb
11 lib/omniauth/strategies/taobao.rb
@@ -11,13 +11,18 @@ def request_phase
11 11 options[:state] ||= '1'
12 12 super
13 13 end
14   -
  14 +
  15 + # def callback_url
  16 + # "http://www.zuiyouji.com:3000" + script_name + callback_path
  17 + # end
15 18
16 19 uid { raw_info['uid'] }
17 20
18 21 info do
19 22 {
20 23 'uid' => raw_info['uid'],
  24 + 'nickname' => raw_info['nick'],
  25 + 'email' => raw_info['email'],
21 26 'user_info' => raw_info,
22 27 'extra' => {
23 28 'user_hash' => raw_info,
@@ -29,7 +34,7 @@ def raw_info
29 34 url = 'http://gw.api.taobao.com/router/rest'
30 35
31 36 query_param = {
32   - :app_key => client_id,
  37 + :app_key => options.client_id,
33 38
34 39 # TODO to be moved in options
35 40 # TODO add more default fields (http://my.open.taobao.com/apidoc/index.htm#categoryId:1-dataStructId:3)
@@ -50,7 +55,7 @@ def raw_info
50 55
51 56 def generate_sign(params)
52 57 # params.sort.collect { |k, v| "#{k}#{v}" }
53   - str = client_secret + params.sort {|a,b| "#{a[0]}"<=>"#{b[0]}"}.flatten.join + client_secret
  58 + str = options.client_secret + params.sort {|a,b| "#{a[0]}"<=>"#{b[0]}"}.flatten.join + options.client_secret
54 59 params['sign'] = Digest::MD5.hexdigest(str).upcase!
55 60 params
56 61 end

0 comments on commit cf37207

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