omniauth-clio 0.0.15 → 0.0.21
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/omniauth/strategies/Clio.rb +12 -5
- data/lib/omniauth-clio/version.rb +1 -1
- metadata +1 -1
@@ -9,11 +9,19 @@ module OmniAuth
|
|
9
9
|
option :client_options, {
|
10
10
|
:site => 'https://app.goclio.com',
|
11
11
|
:authorize_url => '/oauth/authorize',
|
12
|
-
:token_url => '/oauth/
|
12
|
+
:token_url => '/oauth/token'
|
13
13
|
}
|
14
14
|
|
15
15
|
uid { raw_info['id']}
|
16
16
|
|
17
|
+
info do
|
18
|
+
{
|
19
|
+
:last_name => raw_info.parsed['user']['last_name']
|
20
|
+
:first_name => raw_info.parsed['user']['first_name']
|
21
|
+
:email => raw_info.parsed['user']['email']
|
22
|
+
:firm => raw_info.parsed['account']['name']
|
23
|
+
}
|
24
|
+
|
17
25
|
def authorize_params
|
18
26
|
super.tap do |params|
|
19
27
|
params[:response_type] = "code"
|
@@ -38,13 +46,12 @@ module OmniAuth
|
|
38
46
|
end
|
39
47
|
|
40
48
|
extra do
|
41
|
-
{:raw_info => raw_info}
|
49
|
+
{:raw_info => raw_info.parsed}
|
42
50
|
end
|
43
51
|
|
44
52
|
def raw_info
|
45
|
-
access_token.options[:
|
46
|
-
|
47
|
-
@raw_info ||= MultiJson.load(access_token.get('https://app.goclio.com/api/v1/users/who_am_i').body)
|
53
|
+
access_token.options[:parse] = :json
|
54
|
+
@raw_info ||= access_token.get('api/v1/users/who_am_i')
|
48
55
|
end
|
49
56
|
end
|
50
57
|
end
|