omniauth-krystal 1.0.2 → 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: '049356cb76b852f8c9b154677f14aff9f4e17af839d22a37f35a6b28b985960a'
4
- data.tar.gz: d157b48040898ca1cd86638e6ad8e0baf5285b80473ed5936e3fab7cc74102cc
3
+ metadata.gz: 81124af273cae23b77ab10b6e278bcfe6b2968060949bdc7d13cad9989035afb
4
+ data.tar.gz: 15556c4d72fbe57dedc461001ea39f5b86ae87b4ca723fbf5fc1756f7480ef6f
5
5
  SHA512:
6
- metadata.gz: a9cc23de7e8bc7de9d5c0a49e3f1d53fdae9da0a26f74cbf25fc115d99a3c29db75e30b4b65a00bfb59be72f6a49218a8158a60260d9ebaf85217656ca1ad007
7
- data.tar.gz: 6c82a640fabd5e3ef1388e5f63e3aaab6f6dad2ed93266337c6a3f469f8d449f80940201a8469ff6da545a45292f64b9559e242cacdbfcd2da1c749a2e431621
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://oauth.identity.k.io/oauth2/auth'),
13
- token_url: ENV.fetch('KRYSTAL_IDENTITY_OAUTH_TOKEN_URL', 'https://oauth.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.0.2
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: 2022-01-12 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
@@ -67,7 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  requirements: []
70
- rubygems_version: 3.2.32
70
+ rubygems_version: 3.2.33
71
71
  signing_key:
72
72
  specification_version: 4
73
73
  summary: OmniAuth strategy for Krystal Identity