omniauth-krystal 1.1.3 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f64140c4b23240abc668a188f8a6ea105859459f097cfb2aa99db58ef527e20b
4
- data.tar.gz: 7c157cc63737b8ca5f2d96261f0724adf195921c35477cf6d6bbedd0993abd1c
3
+ metadata.gz: 81124af273cae23b77ab10b6e278bcfe6b2968060949bdc7d13cad9989035afb
4
+ data.tar.gz: 15556c4d72fbe57dedc461001ea39f5b86ae87b4ca723fbf5fc1756f7480ef6f
5
5
  SHA512:
6
- metadata.gz: 8a2f572a95e3f70fd85c5441253ad44fac34c6ece74e90ab61ae02f4171d8f925c019d683e9c833d56de36c1a743af3eb00fdd7ee61f72c358da69cbf450a121
7
- data.tar.gz: 606e3760ab86c72f57df206a93624a1d48b7a666714dcd8199a20befd5bc56d5eab1a2e746f21704e9034d95ed5ffafb0d0e731c5a4a1fe776bfd49713e921c6
6
+ metadata.gz: 0e27564482e407b327c7d5744071499b1d8867dfa013b73df5f92304eb9ccf59908d873275a4de533c61c1b8c755107372ca5a5120cc0d8857d01913b475c3a9
7
+ data.tar.gz: 4914bbd1e8f481e872acb7376499eee17386415d3e33e1314e779551374874ae6aa7cf7a604b6df812b6673fbc758ec1255011316e767431280458c5acefd76e
@@ -8,9 +8,10 @@ module OmniAuth
8
8
  option :name, 'krystal'
9
9
 
10
10
  option :client_options,
11
- site: ENV.fetch('KRYSTAL_IDENTITY_API_URL', 'https://identity.k.io/api/v1'),
12
- authorize_url: ENV.fetch('KRYSTAL_IDENTITY_OAUTH_AUTHORIZE_URL', 'https://identity.k.io/oauth2/auth'),
13
- token_url: ENV.fetch('KRYSTAL_IDENTITY_OAUTH_TOKEN_URL', 'https://identity.k.io/oauth2/token')
11
+ url: ENV.fetch('KRYSTAL_IDENTITY_URL', 'https://identity.k.io'),
12
+ site: ENV.fetch('KRYSTAL_IDENTITY_API_URL', nil),
13
+ authorize_url: ENV.fetch('KRYSTAL_IDENTITY_OAUTH_AUTHORIZE_URL', nil),
14
+ token_url: ENV.fetch('KRYSTAL_IDENTITY_OAUTH_TOKEN_URL', nil)
14
15
 
15
16
  option :authorize_params,
16
17
  scope: 'user.profile'
@@ -27,10 +28,24 @@ module OmniAuth
27
28
  extra do
28
29
  {
29
30
  raw_info: raw_info,
30
- scope: scope
31
+ scope: scope,
32
+ session_id: raw_info['session_id'],
33
+ first_name: raw_info['user']['first_name'],
34
+ last_name: raw_info['user']['last_name'],
35
+ email_addresses: raw_info['user']['email_addresses'],
36
+ roles: raw_info['user']['roles'],
37
+ two_factor_auth_enabled: raw_info['user']['two_factor_auth_enabled']
31
38
  }
32
39
  end
33
40
 
41
+ def initialize(app, *args, &block)
42
+ super
43
+
44
+ options.client_options.site ||= "#{options.client_options.url}/api/v1"
45
+ options.client_options.authorize_url ||= "#{options.client_options.url}/oauth2/auth"
46
+ options.client_options.token_url ||= "#{options.client_options.url}/oauth2/token"
47
+ end
48
+
34
49
  def scope
35
50
  access_token['scope']
36
51
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-krystal
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Cooke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-18 00:00:00.000000000 Z
11
+ date: 2023-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth