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.
@@ -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/access_token'
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[:mode] = :query
46
- access_token.options[:param_name] = :access_token
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
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Clio
3
- VERSION = "0.0.15"
3
+ VERSION = "0.0.21"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-clio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.15
4
+ version: 0.0.21
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: