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 +4 -4
- data/lib/omniauth/strategies/krystal.rb +19 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81124af273cae23b77ab10b6e278bcfe6b2968060949bdc7d13cad9989035afb
|
4
|
+
data.tar.gz: 15556c4d72fbe57dedc461001ea39f5b86ae87b4ca723fbf5fc1756f7480ef6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
12
|
-
|
13
|
-
|
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.
|
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-
|
11
|
+
date: 2023-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth
|