omniauth-pipefy 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ffb4a0dd75fa7600025d99e26ecbae8347521bde
4
- data.tar.gz: e7efe7edef7e290debda97bc39c846e8d0c8734b
3
+ metadata.gz: 3d7434446d71c62092dfebfb8f5304258c1c6781
4
+ data.tar.gz: 000435922ecd198b4bd3d94774dfab7740ae327f
5
5
  SHA512:
6
- metadata.gz: 7bf584640dc54a5e922209076202c10b903f08c60e4975b9b4d068287d3b73ea4bc396903e1abea163d36b1199979f7f4f079735df363c669dad5fb90bd920c6
7
- data.tar.gz: 09804252b4c991bfa21e4ce2345f87c2197f57f3d619703fddc389ea25af586b732712aedbdcb852f9687e07dfc0f1b8345cdb1e3c312529849f6cdf43d354e3
6
+ metadata.gz: 58e766bdf172dbf9ecea1f5ea6c80e8df3f32044d129616a565a772d30ca4b8f43ab121a67b7b81886583d46d5e8452330382723179be9f1c37dd9f3bc483a29
7
+ data.tar.gz: 4b61efb8df5906b00c9b25bec1b874e2207bdce168f5b136d6320c658cecacbf1499caebbc793a6139cc0b174217e905153921a8e959df2b78bb8e7555463578
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module Pipefy
3
- VERSION = "0.1.0"
3
+ VERSION = '0.1.1'
4
4
  end
5
5
  end
@@ -6,23 +6,28 @@ module OmniAuth
6
6
  option :name, :pipefy
7
7
 
8
8
  option :client_options,
9
- site: 'https://app.pipefy.com',
9
+ site: ENV.fetch('PIPEFY_URL', 'https://app.pipefy.com'),
10
10
  authorize_url: '/oauth/authorize'
11
11
 
12
- uid { raw_info['resource_owner_id'] }
12
+ uid { user_info['id'] }
13
13
 
14
- info do
15
- {
16
- username: raw_info['username'],
17
- name: raw_info['name'],
18
- email: raw_info['email'],
19
- avatar: raw_info['avatar_url']
20
- }
21
- end
14
+ info do
15
+ {
16
+ user_id: user_info['id'],
17
+ username: user_info['username'],
18
+ name: user_info['name'],
19
+ email: user_info['email'],
20
+ avatar: user_info['avatar_url']
21
+ }
22
+ end
22
23
 
23
- def raw_info
24
- @raw_info ||= access_token.get('/oauth/token/info').parsed
25
- end
24
+ def token_info
25
+ @token_info ||= access_token.to_h
26
+ end
27
+
28
+ def user_info
29
+ @user_info ||= token_info['user']
30
+ end
26
31
 
27
32
  def callback_url
28
33
  full_host + script_name + callback_path
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-pipefy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcio Trindade