omniauth-clio 0.0.21 → 0.0.22
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/omniauth-clio/version.rb +1 -1
- data/lib/omniauth/strategies/Clio.rb +10 -8
- metadata +1 -1
@@ -12,15 +12,16 @@ module OmniAuth
|
|
12
12
|
:token_url => '/oauth/token'
|
13
13
|
}
|
14
14
|
|
15
|
-
uid { raw_info['id']}
|
15
|
+
uid { raw_info['user']['id']}
|
16
16
|
|
17
17
|
info do
|
18
18
|
{
|
19
|
-
:last_name => raw_info
|
20
|
-
:first_name => raw_info
|
21
|
-
:email => raw_info
|
22
|
-
:firm => raw_info
|
19
|
+
:last_name => raw_info['user']['last_name'],
|
20
|
+
:first_name => raw_info['user']['first_name'],
|
21
|
+
:email => raw_info['user']['email'],
|
22
|
+
:firm => raw_info['account']['name'],
|
23
23
|
}
|
24
|
+
end
|
24
25
|
|
25
26
|
def authorize_params
|
26
27
|
super.tap do |params|
|
@@ -46,12 +47,13 @@ module OmniAuth
|
|
46
47
|
end
|
47
48
|
|
48
49
|
extra do
|
49
|
-
{:raw_info => raw_info
|
50
|
+
{:raw_info => raw_info}
|
50
51
|
end
|
51
52
|
|
52
53
|
def raw_info
|
53
|
-
access_token.
|
54
|
-
|
54
|
+
@raw_info ||= MultiJson.load(access_token.get('/api/v1/users/who_am_i').body)
|
55
|
+
rescue ::Errno::ETIMEDOUT
|
56
|
+
raise ::Timeout::Error
|
55
57
|
end
|
56
58
|
end
|
57
59
|
end
|