omniauth-clio 0.0.151 → 0.0.211
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 +18 -0
- metadata +1 -1
@@ -12,6 +12,15 @@ module OmniAuth
|
|
12
12
|
:token_url => '/oauth/token'
|
13
13
|
}
|
14
14
|
|
15
|
+
uid { raw_info['id']}
|
16
|
+
|
17
|
+
info do
|
18
|
+
{
|
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
|
+
}
|
15
24
|
|
16
25
|
def authorize_params
|
17
26
|
super.tap do |params|
|
@@ -36,6 +45,15 @@ module OmniAuth
|
|
36
45
|
client.get_token(token_params)
|
37
46
|
end
|
38
47
|
|
48
|
+
extra do
|
49
|
+
{:raw_info => raw_info}
|
50
|
+
end
|
51
|
+
|
52
|
+
def raw_info
|
53
|
+
@raw_info ||= MultiJson.load(access_token.get('/api/v1/users/who_am_i').body)
|
54
|
+
rescue ::Errno::ETIMEDOUT
|
55
|
+
raise ::Timeout::Error
|
56
|
+
end
|
39
57
|
end
|
40
58
|
end
|
41
59
|
end
|