omniauth-humanid 0.0.20 → 0.0.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/omniauth-humanid.rb +10 -18
- data/omniauth-humanid.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23ca49a4994aa57c0761c4ff9123cc12451e584f9680976e6d7a2248d11bcb30
|
4
|
+
data.tar.gz: 1b35468f60248fa23bb234a4bee573b8433ce6d04a39c1922922b9e025b6189d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a481ecdff7cadf8c80cee712b061b0fff0dc7828b62984e874bed8f87eb121c29a1ae8b385823fe2391e829bcc34090b7801c999a504c9b6e38f55fea510c90
|
7
|
+
data.tar.gz: 4707be38708ac0ccee865ba7d6f1fa4f36e3a5092b94201b5cc9f6fe3eaca1fb33786a85f0989bed0c75d7a16b94f2528ca65eb4cef8b249f914e21e99edc358
|
data/Gemfile.lock
CHANGED
data/lib/omniauth-humanid.rb
CHANGED
@@ -21,6 +21,8 @@ module OmniAuth
|
|
21
21
|
option :client_id, nil
|
22
22
|
option :exchange_url, "https://core.human-id.org/[HUMANID_VERSION]/server/users/exchange"
|
23
23
|
|
24
|
+
attr_accessor :raw_info
|
25
|
+
|
24
26
|
# def self.humanid_button
|
25
27
|
# #see https://docs.human-id.org/web-sdk-integration-guide
|
26
28
|
# %Q{<a href="#{options.local_sign_up_url}">
|
@@ -121,8 +123,9 @@ module OmniAuth
|
|
121
123
|
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true){|http| http.request(post_request)}
|
122
124
|
Rails.logger.info("RESPONSE: #{res}")
|
123
125
|
if res.code == "200"
|
124
|
-
|
125
|
-
Rails.logger.info(
|
126
|
+
self.raw_info = JSON.parse(res.body)
|
127
|
+
Rails.logger.info("raw: #{raw_info}")
|
128
|
+
super
|
126
129
|
else
|
127
130
|
str = "Issue with the callback_phase of humanid omniauth, response from human id has code: #{res.code}, and body: #{res.body}"
|
128
131
|
Rails.logger.error str
|
@@ -130,23 +133,12 @@ module OmniAuth
|
|
130
133
|
end
|
131
134
|
end
|
132
135
|
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
alias userAppId uid
|
137
|
-
|
138
|
-
def countryCide
|
139
|
-
request.env['omniauth.auth']['data']['countryCide']
|
136
|
+
#not a method? Some DSL magic that is not explained in docs. Just looked at other projects and they did something like this so
|
137
|
+
info do
|
138
|
+
raw_info['data']
|
140
139
|
end
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
def info
|
145
|
-
request.env['omniauth.auth']['data']
|
146
|
-
end
|
147
|
-
|
148
|
-
def extra
|
149
|
-
request.env['omniauth.auth']
|
140
|
+
uid do
|
141
|
+
raw_info['data']['userAppId']
|
150
142
|
end
|
151
143
|
end
|
152
144
|
end
|
data/omniauth-humanid.gemspec
CHANGED