xoauth 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/oauth/provider/qq.rb +9 -9
- data/lib/oauth/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f826eae0a3c110b25274e5d24eef9badbc743b33
|
4
|
+
data.tar.gz: 6f56a965dbf111484d56f1c052e8a2c0ae9ad2f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91ba46879d068b6e713935a75d6c40615a8d055b40d9cf802347d57519a90dd527f9c02286368dca5ac921b65d8710035b0fd2e5b198b5a20e29014c8c15817f
|
7
|
+
data.tar.gz: f89fa2b17d92c8650aaf83a5214fcb17382aa43425041a92857c57e469fad173616a518f2a0c45894632f0aea533091a5b04588ae07e4dcd9d6f4e92988abc53
|
data/lib/oauth/provider/qq.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
module Oauth
|
2
|
-
class
|
2
|
+
class Qq < Provider
|
3
3
|
|
4
4
|
def fetch_info
|
5
5
|
api_access('get_user_info')
|
@@ -7,18 +7,18 @@ module Oauth
|
|
7
7
|
|
8
8
|
def basic_info
|
9
9
|
info && {
|
10
|
-
"name" => info.data["
|
11
|
-
"avatar" => info.data["
|
12
|
-
"gender" => info.data["gender"],
|
13
|
-
"location" => info.data["
|
14
|
-
"description" =>
|
10
|
+
"name" => info.data["nickname"],
|
11
|
+
"avatar" => info.data["figureurl_2"],
|
12
|
+
"gender" => (info.data["gender"] == '女' ? 0 : 1),
|
13
|
+
"location" => info.data["city"],
|
14
|
+
"description" => nil
|
15
15
|
}
|
16
16
|
end
|
17
17
|
|
18
18
|
def api_access(api, http_params = {}, http_method = 'get')
|
19
19
|
url = 'https://graph.qq.com/user/' + api
|
20
20
|
http_params.merge!({"access_token" => access_token, "openid"=> uid, "oauth_consumer_key" => Configure['qq']['appid']})
|
21
|
-
Oauth::
|
21
|
+
Oauth::Qq.request(url, http_params, http_method, 'json')
|
22
22
|
end
|
23
23
|
|
24
24
|
class << self
|
@@ -53,7 +53,7 @@ module Oauth
|
|
53
53
|
code: code,
|
54
54
|
redirect_uri: Configure['qq']['callback']
|
55
55
|
}
|
56
|
-
response =
|
56
|
+
response = get('https://graph.qq.com/oauth2.0/token', get_params)
|
57
57
|
if response # access_token=xxx&expires_in=7776000&refresh_token=xxx
|
58
58
|
detail = Hash[response.split('&').map{|q| q.split('=')}]
|
59
59
|
detail['uid'] = openid(detail["access_token"])
|
@@ -69,5 +69,5 @@ module Oauth
|
|
69
69
|
end
|
70
70
|
|
71
71
|
end
|
72
|
-
class
|
72
|
+
class QqMobile < Qq; end
|
73
73
|
end
|
data/lib/oauth/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xoauth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- binz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-04-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|