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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 73bac9396336b430957d2055ecf42bc2beeb9e8dc074bfdd724ec25241ceb146
4
- data.tar.gz: fc808758428d8d81e06da8351afbb600fb38dfc32c026a8fae456f9836cbb9bc
3
+ metadata.gz: 23ca49a4994aa57c0761c4ff9123cc12451e584f9680976e6d7a2248d11bcb30
4
+ data.tar.gz: 1b35468f60248fa23bb234a4bee573b8433ce6d04a39c1922922b9e025b6189d
5
5
  SHA512:
6
- metadata.gz: 5c534d28064f18c63b75141400ff9bb0f6a388450a696b30a8d99850f4850a3b6b6cd876cb035aa59573be40cb9f1610c248562d22f51aebf5675926c7376e87
7
- data.tar.gz: 1d86533a039f20ddeaf992e748cd18940d1cafda30d1ad285ca67dac402349fba4076c35688dae70fffed0d6e5daad29b7d7c2cfac18b3c700ca8c403b0f3a4c
6
+ metadata.gz: 5a481ecdff7cadf8c80cee712b061b0fff0dc7828b62984e874bed8f87eb121c29a1ae8b385823fe2391e829bcc34090b7801c999a504c9b6e38f55fea510c90
7
+ data.tar.gz: 4707be38708ac0ccee865ba7d6f1fa4f36e3a5092b94201b5cc9f6fe3eaca1fb33786a85f0989bed0c75d7a16b94f2528ca65eb4cef8b249f914e21e99edc358
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- omniauth-humanid (0.0.20)
4
+ omniauth-humanid (0.0.23)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -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
- request.env['omniauth.auth'] = JSON.parse(res.body)
125
- Rails.logger.info(request.env['omniauth.auth'])
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
- def uid
134
- request.env['omniauth.auth']['data']['userAppId']
135
- end
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
- alias country_cide countryCide
142
- alias country_code countryCide
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
@@ -1,4 +1,4 @@
1
- version = '0.0.20'
1
+ version = '0.0.23'
2
2
  #version must be on the first line for the update script
3
3
 
4
4
  Gem::Specification.new do |spec|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-humanid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.20
4
+ version: 0.0.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luke Clancy