omniauth-geekpark 1.0.1 → 1.0.2

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: 9c697f4f2a1a945ad94aa3dc2f7c3a1dd3b9ee13
4
- data.tar.gz: f1f135051844ab711a2190d600901d02eefff24f
3
+ metadata.gz: 352ea839f177a4ced8152329b5df1d554e151bc2
4
+ data.tar.gz: bbeb66bf992137b42b9bac54d49fee94aee90604
5
5
  SHA512:
6
- metadata.gz: ef6a88c9a14bfb8eb80881091e58d78cfeb8beb114d7b5975ed5b1b6f03dffffae27a50d7d2ef83cadef16a0881a4a1b1f0ed9fee8cd16d8b0b5d3e0bc43d227
7
- data.tar.gz: b2d7ecf0690985f89f96eed8e484adc13c830f1a45292266e050b3454e356c369acb7c75c9e1e47fd75d7522f0fa3866e1e39161f92139bd7a768ebd53c3854c
6
+ metadata.gz: 70797f50a0b2de7b0a5dc6af5d5a07c0ac0c4e3b510103754b090535a2b8dfd8ebda4585ea0e6bb74f49a5476a5a7ede2d2910b532a13351a27e718ffe29f9b9
7
+ data.tar.gz: 3fe2c67c99f53f90d0ce50e8b9e612034c75d9e7f9470d8d6c2b657c4e44720427fde81461386f2ceec22106251bc8c868a863ab4b05fe92340ed190a9b31069
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module GeekPark
3
- VERSION = '1.0.1'
3
+ VERSION = '1.0.2'
4
4
  end
5
5
  end
@@ -7,6 +7,8 @@ module OmniAuth
7
7
  token_url: 'https://api.weixin.qq.com/sns/oauth2/access_token',
8
8
  }
9
9
 
10
+ option :provider_ignores_state, true
11
+
10
12
  uid { raw_info['unionid'] }
11
13
 
12
14
  info do
@@ -36,7 +38,6 @@ module OmniAuth
36
38
  end
37
39
 
38
40
  def authorize_params
39
- options.authorize_params[:state] = SecureRandom.hex(24)
40
41
  params = options.authorize_params.merge({
41
42
  appid: options.client_id,
42
43
  redirect_uri: callback_url,
@@ -47,7 +48,10 @@ module OmniAuth
47
48
  @env ||= {}
48
49
  @env["rack.session"] ||= {}
49
50
  end
50
- session["omniauth.state"] = params[:state]
51
+ unless options.provider_ignores_state
52
+ params[:state] = SecureRandom.hex(24)
53
+ session["omniauth.state"] = params[:state]
54
+ end
51
55
  params
52
56
  end
53
57
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-geekpark
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - HaoYunfei