omniauth-weibo-oauth2 0.4.5 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 02c17661c1919e2b6c55b1a9ecdb6f30da587bc7
4
- data.tar.gz: d77d0c69a9e207f5a40de7c570016ad758393cb2
3
+ metadata.gz: 5e639970c9ca1435caca8e77c1340e9d3aecad78
4
+ data.tar.gz: 37f0ccbeca65351bb326083fb2e8c585870dd880
5
5
  SHA512:
6
- metadata.gz: 3349f45a10fb85ad7bd199d7cedcf04d1a2b2667c6a373b740fb45331d5a2c4885b32d010b3cf63ed68d966545b3015e0145a275876b4287d8c4fd54c0cae792
7
- data.tar.gz: 1ca72151aa96bd53e2aa7de280a5a2c576949cb3068c3ec909627f28808dceff0505c54130ae70a4d5119b5505d2c4eb95952b41bc02e3058100b9a6d1a4ef60
6
+ metadata.gz: 4b1c35d239c1bd8e1e778bc66127ca7bb45bcea110ab9f27947c9e1ebed44efebaf39d7797bb1c5b3709e489e0bec6e25c4a443d113ee237039bbffc5e6d4d43
7
+ data.tar.gz: cbeb61f9ac6c1b8396622253f6c0b2a041389ddcd571efeee2bc89636158842d911e23e2c11d084ff942e442052f18e0009f171b5441fa5f3b600edb763344b3
@@ -2,6 +2,4 @@ before_install:
2
2
  - gem update --system 2.1.11
3
3
  language: ruby
4
4
  rvm:
5
- - "2.0.0"
6
- - "2.1.0"
7
5
  - "2.4.1"
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module WeiboOauth2
3
- VERSION = "0.4.5"
3
+ VERSION = "0.5.1"
4
4
  end
5
5
  end
@@ -26,7 +26,7 @@ module OmniAuth
26
26
  :description => raw_info['description'],
27
27
  :urls => {
28
28
  'Blog' => raw_info['url'],
29
- 'Weibo' => raw_info['domain'].empty? ? "http://weibo.com/u/#{raw_info['id']}" : "http://weibo.com/#{raw_info['domain']}",
29
+ 'Weibo' => raw_info['domain'].empty? ? "https://weibo.com/u/#{raw_info['id']}" : "https://weibo.com/#{raw_info['domain']}",
30
30
  }
31
31
  }
32
32
  end
@@ -37,6 +37,10 @@ module OmniAuth
37
37
  }
38
38
  end
39
39
 
40
+ def callback_url
41
+ full_host + script_name + callback_path
42
+ end
43
+
40
44
  def raw_info
41
45
  access_token.options[:mode] = :query
42
46
  access_token.options[:param_name] = 'access_token'
@@ -77,10 +81,11 @@ module OmniAuth
77
81
  #
78
82
  def authorize_params
79
83
  super.tap do |params|
80
- %w[display with_offical_account forcelogin].each do |v|
84
+ %w[display with_offical_account forcelogin state].each do |v|
81
85
  if request.params[v]
82
86
  params[v.to_sym] = request.params[v]
83
87
  end
88
+ session["omniauth.state"] = params[v.to_sym] if v == 'state'
84
89
  end
85
90
  end
86
91
  end
@@ -88,13 +93,13 @@ module OmniAuth
88
93
  protected
89
94
  def build_access_token
90
95
  params = {
91
- 'client_id' => client.id,
96
+ 'client_id' => client.id,
92
97
  'client_secret' => client.secret,
93
- 'code' => request.params['code'],
94
- 'grant_type' => 'authorization_code',
95
- 'redirect_uri' => options['redirect_uri']
96
- }.merge(token_params.to_hash(symbolize_keys: true))
97
- client.get_token(params, deep_symbolize(options.auth_token_params))
98
+ 'code' => request.params['code'],
99
+ 'grant_type' => 'authorization_code',
100
+ 'redirect_uri' => callback_url
101
+ }.merge(token_params.to_hash(symbolize_keys: true))
102
+ client.get_token(params, deep_symbolize(options.token_params))
98
103
  end
99
104
 
100
105
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-weibo-oauth2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.5
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bin He
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-04 00:00:00.000000000 Z
11
+ date: 2018-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
74
  version: '0'
75
75
  requirements: []
76
76
  rubyforge_project:
77
- rubygems_version: 2.6.12
77
+ rubygems_version: 2.6.13
78
78
  signing_key:
79
79
  specification_version: 4
80
80
  summary: OmniAuth Oauth2 strategy for weibo.com.