reputable 0.1.14 → 0.1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c71694602b9f9eb25537c91c895503e068d59f36b9fbafcefcb7104acacd945f
4
- data.tar.gz: 95fabaa4a264c471b46957b781b49cef0cda4205ab35d312ebb85497d9a88657
3
+ metadata.gz: 46a14f8686b7e3ad1aa8a8c2e22f5c14f13a3d6667ad9bb4ca1e088024989f7d
4
+ data.tar.gz: 6b6e95c46a329214b02279c23d02b55067f8a86f74cc6f17159b35dd43d08ef6
5
5
  SHA512:
6
- metadata.gz: 4a8f05f1bc68354e88b6591873de564f4dbc56531209d7b00781536d23303d969447f05f76bd040b8e078efc836c8697ef1894342168e93c1c5592eb3af62639
7
- data.tar.gz: dcd56a2d35fb3d162ffe0813e336212ce61d3e57a6e64d94303f9198b62849211e24879a7302073d4f1e0d3fa90ad765edc0ce6e941951e38a9a67c4dfb6f5fe
6
+ metadata.gz: 542429b9c9716d69889873b9212b4500669a074c24595f8f933f64568161ca6a562de7b6aa307ede64252b35599d5e768279abee078724d358ab2a2bc14f6f90
7
+ data.tar.gz: e3978a1b8e21332bd1a7e1ef26a719398c478762f74a5959bdc8c85c720de7fe97a03b4c525df7c892273329f8c1d02c1fe38163fcdee21d92479dfc81b735a2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- reputable (0.1.14)
4
+ reputable (0.1.15)
5
5
  connection_pool (~> 2.2)
6
6
  redis (>= 4.0, < 6.0)
7
7
 
@@ -145,16 +145,35 @@ module Reputable
145
145
 
146
146
  def handle_verification_return(env)
147
147
  request = Rack::Request.new(env)
148
- # Quick check to avoid overhead
149
- return unless request.query_string.include?("reputable_status")
150
-
151
- return unless request.params["reputable_status"] == "pass"
148
+ # Quick check to avoid overhead - support both new (reputable_r) and legacy (reputable_status) formats
149
+ query = request.query_string
150
+ return unless query.include?("reputable_r") || query.include?("reputable_status")
151
+
152
+ params = request.params
153
+
154
+ # Determine status from new format or legacy format
155
+ status = if params["reputable_r"]
156
+ decoded = Reputable.decode_reputable_response(params)
157
+ decoded&.dig("status")
158
+ else
159
+ params["reputable_status"]
160
+ end
152
161
 
153
- if Reputable.verify_redirect_return(request.params)
162
+ return unless status == "pass"
163
+
164
+ if Reputable.verify_redirect_return(params)
154
165
  env["reputable.verified"] = true
155
- ignore_analytics = request.params["reputable_ignore_analytics"]
166
+
167
+ # Extract ignore_analytics from new format or legacy format
168
+ ignore_analytics = if params["reputable_r"]
169
+ decoded = Reputable.decode_reputable_response(params)
170
+ decoded&.dig("ignore_analytics")
171
+ else
172
+ params["reputable_ignore_analytics"]
173
+ end
174
+
156
175
  unless ignore_analytics.nil?
157
- env["reputable.ignore_analytics"] = ignore_analytics.to_s == "true"
176
+ env["reputable.ignore_analytics"] = ignore_analytics == true || ignore_analytics.to_s == "true"
158
177
  end
159
178
 
160
179
  # Store in session if available
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Reputable
4
- VERSION = "0.1.14"
4
+ VERSION = "0.1.15"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reputable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.14
4
+ version: 0.1.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Reputable