omniauth-wechat-oauth2 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b596173aeb57291ce355797589fca0a6d5dee5ac7f9aa733b98f24d6f140bcd4
4
- data.tar.gz: f8cca424225ed5f3b21cff98adfb9fba811fc4a83564460a27eb9350d9240b9b
3
+ metadata.gz: f2db2a6ffccd120dc2aea814ea578ac393d9489dbc6c9a464b3e6b89f4840739
4
+ data.tar.gz: 4f2b9269d515f278d52eae8f66b2ebc2442730a6293a123e7cb27704f5c45294
5
5
  SHA512:
6
- metadata.gz: 83052c403dd1113817c4d7025c8a51e80c546c3c75bc957e43f32af03a6636315c108b9c6a97ed3f4900aa3bf5545a76206d37a55820c3252624ece3313a6282
7
- data.tar.gz: cae0c49e4f08e918b26e81992ff5758b3289de2d4596567efcb31a82ed19e102471b0b1bc792df821571251b47f0392b4ac5f907309c411f1bc4d85c1dd46a14
6
+ metadata.gz: c26fac5621c86fb639866d329ed5c3a34791a542c3bd47ebe5a60e8cdf1ef7d9b82590273142c1d3e852fefa4f8e50f64126ae42992044ed512bff3e3d8f00ee
7
+ data.tar.gz: 6443a43f47bc03cb1579e27ec555bce0014c22b74ac9e81612ac5d197e7068612766b3139c69de0397839d437e6c77e0a113e507a3dccddb9040bb83631c4a12
@@ -50,15 +50,13 @@ module OmniAuth
50
50
  @uid ||= access_token["openid"]
51
51
  @raw_info ||= begin
52
52
  access_token.options[:mode] = :query
53
- if access_token["scope"] == "snsapi_userinfo"
54
- response = access_token.get("/sns/userinfo", :params => {"openid" => @uid, "lang" => "zh_CN"}, parse: :text)
55
- @raw_info = JSON.parse(response.body.gsub(/[\u0000-\u001f]+/, ''))
53
+ if access_token["scope"]&.include?("snsapi_login")
54
+ access_token.get("/sns/userinfo", :params => { "openid" => @uid, "lang" => "zh_CN" }, parse: :json).parsed
56
55
  else
57
- @raw_info = {"openid" => @uid }
58
- @raw_info.merge!("unionid" => access_token["unionid"]) if access_token["unionid"]
59
- @raw_info
56
+ { "openid" => @uid }
60
57
  end
61
58
  end
59
+ @raw_info
62
60
  end
63
61
 
64
62
  protected
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-wechat-oauth2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Hu
8
8
  - Never Min
9
9
  - Eric Guo
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2019-05-02 00:00:00.000000000 Z
13
+ date: 2020-06-09 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: omniauth
@@ -72,7 +72,7 @@ homepage: https://github.com/nevermin/omniauth-wechat-oauth2
72
72
  licenses:
73
73
  - MIT
74
74
  metadata: {}
75
- post_install_message:
75
+ post_install_message:
76
76
  rdoc_options: []
77
77
  require_paths:
78
78
  - lib
@@ -80,7 +80,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
80
80
  requirements:
81
81
  - - ">="
82
82
  - !ruby/object:Gem::Version
83
- version: 2.0.0
83
+ version: 2.3.0
84
84
  required_rubygems_version: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - ">="
@@ -88,8 +88,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
88
  version: '0'
89
89
  requirements:
90
90
  - none
91
- rubygems_version: 3.0.3
92
- signing_key:
91
+ rubygems_version: 3.1.4
92
+ signing_key:
93
93
  specification_version: 4
94
94
  summary: Omniauth strategy for wechat(weixin)
95
95
  test_files: []