omniauth-fenix 0.3.7 → 0.3.8

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: df80e8d71ef052524edb0385bc20632e6c5c6668
4
- data.tar.gz: cc3f49edca26e35565269138c60703a388561c80
3
+ metadata.gz: e84aa0609d614d2d5d29ae159927a8d793040642
4
+ data.tar.gz: 3f03201f5ac2428ce2c2f3a4ed4e1b7b36c28306
5
5
  SHA512:
6
- metadata.gz: ca1dc239f8dc3127fe5900281cb6598c012219293ea29714f2f7a0591b1eeb006b9efd45e15b3832c54a08f3e82f324e6c3bae0ece2691b29f88b1d989ba28d4
7
- data.tar.gz: efdbdb143507bc55cb4a36f35a80912419aa23f0779b3bc0a6a30c6953759d0deec2f6d0e023a79fb2c88a3d880f11934d2363e2b3dca76999bcddc2f6ec618f
6
+ metadata.gz: 7caf548960dbb65476928d1661b4c08b7b71be3490f84eb1b07cfb743839c560b77bebff5c05be6d6864abf23d58c218df74f2e5ec3061a2040cf445f45fc38b
7
+ data.tar.gz: d663c3a3577f334578427c758268657fc57958bf7540a2b5a50c693a031cf8cfb35d2cb82e66e1fb69bde53285cd35be2d3eaf8a1f40935b11bca6a2621566a0
@@ -11,9 +11,6 @@ module OmniAuth
11
11
  :authorize_url => 'https://fenix.tecnico.ulisboa.pt/oauth/'
12
12
  }
13
13
 
14
- AUTHORIZE_URL = 'https://fenix.tecnico.ulisboa.pt/oauth/'
15
- CALLBACK_URL = 'http://192.168.99.100:3000/auth/fenix/callback'
16
-
17
14
  def request_phase
18
15
  redirect request_url
19
16
  end
@@ -31,20 +28,16 @@ module OmniAuth
31
28
 
32
29
  def raw_info
33
30
  access_token.options[:parse] = :json
34
- url = "https://fenix.tecnico.ulisboa.pt/api/fenix/v1/person"
31
+ url = "https://fenix.tecnico.ulisboa.pt/api/fenix/v2/person"
35
32
  params = { :params => { :access_token => access_token.token } }
36
33
  @raw_info ||= access_token.get(url, params).parsed
37
34
  end
38
35
 
39
36
  def build_access_token
40
- puts "JOAO"
41
- puts callback_url
42
- puts "JOAO"
43
-
44
37
  token_params = {
45
38
  :client_id => client.id,
46
39
  :client_secret => client.secret,
47
- :redirect_uri => CALLBACK_URL,
40
+ :redirect_uri => callback_url
48
41
  :code => request.params['code'],
49
42
  :grant_type => 'authorization_code'
50
43
  }
@@ -52,13 +45,14 @@ module OmniAuth
52
45
  client.get_token(token_params)
53
46
  end
54
47
 
48
+ def callback_url
49
+ callback_url.split("?").first
50
+ end
51
+
55
52
  private
56
53
 
57
54
  def request_url
58
- puts "OLA"
59
- puts callback_url
60
- puts "OLA"
61
- "#{AUTHORIZE_URL}userdialog?client_id=#{client.id}&redirect_uri=#{callback_url}"
55
+ "#{options.client_options.fetch(:authorize_url)}userdialog?client_id=#{client.id}&redirect_uri=#{callback_url}"
62
56
  end
63
57
  end
64
58
  end
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module Fenix
3
- VERSION = "0.3.7"
3
+ VERSION = "0.3.8"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-fenix
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rui Mangas Pereira