omniauth-douban-oauth2 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/omniauth/strategies/douban.rb +11 -12
- data/lib/omniauth-douban/version.rb +1 -1
- metadata +5 -5
@@ -16,21 +16,19 @@ module OmniAuth
|
|
16
16
|
}
|
17
17
|
|
18
18
|
uid do
|
19
|
-
raw_info['id']
|
19
|
+
raw_info['id']
|
20
20
|
end
|
21
21
|
|
22
22
|
info do
|
23
23
|
{
|
24
|
-
:
|
25
|
-
:
|
26
|
-
:
|
27
|
-
:
|
28
|
-
:
|
29
|
-
:
|
30
|
-
|
31
|
-
|
32
|
-
:douban => raw_info['link'].find{ |l| l['rel'] == 'alternate' }['href'],
|
33
|
-
}
|
24
|
+
:uid => raw_info['uid'],
|
25
|
+
:name => raw_info['name'],
|
26
|
+
:loc => raw_info['loc'],
|
27
|
+
:avatar => raw_info['avatar'],
|
28
|
+
:url => raw_info['alt'],
|
29
|
+
:desc => raw_info['desc'],
|
30
|
+
:status => raw_info['status'],
|
31
|
+
:created => raw_info['created']
|
34
32
|
}
|
35
33
|
end
|
36
34
|
|
@@ -40,7 +38,8 @@ module OmniAuth
|
|
40
38
|
|
41
39
|
def raw_info
|
42
40
|
access_token.options[:param_name] = 'access_token'
|
43
|
-
|
41
|
+
user_id = access_token.get('/shuo/users/@me').parsed['uid']
|
42
|
+
@raw_info ||= access_token.get("/v2/people/#{ user_id }").parsed
|
44
43
|
rescue ::Timeout::Error => e
|
45
44
|
raise e
|
46
45
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-douban-oauth2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-07-12 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: omniauth
|
16
|
-
requirement: &
|
16
|
+
requirement: &2156128520 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '1.0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2156128520
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: omniauth-oauth2
|
27
|
-
requirement: &
|
27
|
+
requirement: &2156060640 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '1.1'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2156060640
|
36
36
|
description: OmniAuth OAuth2 strategy for Douban.
|
37
37
|
email:
|
38
38
|
- i@liluo.org
|