omniauth-wechat 0.1.8 → 0.1.9
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 +8 -8
- data/lib/omniauth/strategies/wechat.rb +9 -7
- data/lib/omniauth/wechat/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MTI5MDA3NzliYTkwMzRkYThkYmNkNzIxYWU0ZDRlNzdmZTE4YTIzZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YzkyMzI0ODY5NjliMjU2MTZjYTQwNmRmMmFkNGFmNzM0NzQyZmNhNQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
Y2MzMjZhMjIzYzU5NDQzMzMzOTVkYWM0OWE3NTAxMTA2NzI5OGMyNmI2NWJl
|
10
|
+
MzM2NTA4NTkxOGZkZTlmNjY0M2Q5NTZhNWE2MGZkMmVmMzAwODRiM2EzYzE4
|
11
|
+
MmJlZTE3ZmNmNDAwZTBkYjQwZTRjY2M1NWRmNmY4OWIzOWFkOWU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MTEyNTU3YzM1MDU2ZWE1YmNhZTc1N2JjNjMzZDFjZGNhMWZiMmY5ZTMxOWQ5
|
14
|
+
Nzc4ODI4NDdhMTE1YmQ0MDJmYjRiODViNDRjYTE2NDU2MmJiZjNlMGFhZjZj
|
15
|
+
MDg3OWI4NjVhMWQ3ZmZlM2Q3OWY4OTljYzQyM2QxYTIxNDZlOGQ=
|
@@ -48,11 +48,12 @@ module OmniAuth
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def authorize_params
|
51
|
-
|
51
|
+
state_param = SecureRandom.hex(24)
|
52
52
|
options.authorize_params.merge({:appid=>options.appid,
|
53
53
|
:redirect_uri => callback_url,
|
54
54
|
:response_type => 'code',
|
55
|
-
:scope => 'snsapi_userinfo'
|
55
|
+
:scope => 'snsapi_userinfo',
|
56
|
+
:state=>state_param
|
56
57
|
})
|
57
58
|
end
|
58
59
|
|
@@ -125,19 +126,20 @@ module OmniAuth
|
|
125
126
|
|
126
127
|
def build_access_token
|
127
128
|
verifier = request.params['code']
|
128
|
-
request_params =
|
129
|
+
request_params = token_params.to_hash(:symbolize_keys => true).merge({
|
130
|
+
:code=>verifier,
|
129
131
|
:grant_type=>'authorization_code',:parse=>:json
|
130
|
-
}
|
132
|
+
})
|
131
133
|
client.get_token(request_params,{:mode=>:query})
|
132
134
|
|
133
135
|
end
|
134
136
|
|
135
137
|
def refresh_access_token(old_token)
|
136
|
-
request_params = {
|
138
|
+
request_params = {:appid=>options.appid,
|
139
|
+
:grant_type=> 'refresh_token',
|
137
140
|
:refresh_token => old_token.refresh_token,
|
138
|
-
:appid=>options.appid,
|
139
141
|
:parse=>:json
|
140
|
-
}
|
142
|
+
}
|
141
143
|
client({:token_url=>'https://api.weixin.qq.com/sns/oauth2/refresh_token'}).get_token(request_params,{:mode=>:query})
|
142
144
|
end
|
143
145
|
|