verify_it 0.4.0.beta → 0.4.1.beta
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 +4 -4
- data/.DS_Store +0 -0
- data/CHANGELOG.md +10 -0
- data/app/controllers/verify_it/verifications_controller.rb +1 -1
- data/lib/verify_it/verifier.rb +4 -4
- data/lib/verify_it/version.rb +1 -1
- data/lib/verify_it.rb +2 -2
- metadata +2 -7
- data/pkg/verify_it-0.1.0.gem +0 -0
- data/verify_it-0.1.0.gem +0 -0
- data/verify_it-0.1.1.gem +0 -0
- data/verify_it-0.2.0.gem +0 -0
- data/verify_it-0.3.0.gem +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4f2e332e6a7ecae4c16eaf2232cb6f5826c26cd1a5c3de98c98a7cf0f1bf9968
|
|
4
|
+
data.tar.gz: 14e43962ebc0e2b2ca553324aadb0780aa1c2e6b22f4d4a1c6c9ab7fad285442
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cc77c48de4632d3c129dcd3b3f614e909107d906dd3bdbf66d3d0771eb3609a3978916c318ccdaef873544b50f64f1a6be411f5554a8a882b1ec681eda4c0e8e
|
|
7
|
+
data.tar.gz: ecff61e7e94a7aaf27bf91f7ea0e13635c64dcde5413054077d366a8f36e2dd546bb049c18939374885675a8f5fdb9fe714ba82d4cd3caca3f875fe3245a9362
|
data/.DS_Store
CHANGED
|
Binary file
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
### Added
|
|
4
|
+
- `on_verify_success` callback now receives `request:` as an optional keyword argument,
|
|
5
|
+
enabling apps to access HTTP context (e.g. set session) at verification time.
|
|
6
|
+
Thread: `VerifyIt.verify_code(request:)` → `Verifier#verify_code` → `handle_verification_success`.
|
|
7
|
+
Existing proc-based callbacks are unaffected (procs ignore unknown keyword args);
|
|
8
|
+
lambda-based callbacks should add `request: nil` to their signature.
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
- Dropped Ruby 3.1 support; minimum required Ruby is now 3.2 (due to `connection_pool >= 3.0` transitive dependency)
|
|
12
|
+
|
|
3
13
|
## [0.4.0] - 2026-03-07
|
|
4
14
|
|
|
5
15
|
### Added
|
|
@@ -34,7 +34,7 @@ module VerifyIt
|
|
|
34
34
|
|
|
35
35
|
channel = resolve_channel
|
|
36
36
|
identifier = resolve_identifier(record, channel)
|
|
37
|
-
result = VerifyIt.verify_code(to: identifier, code: params[:code].to_s, record: record)
|
|
37
|
+
result = VerifyIt.verify_code(to: identifier, code: params[:code].to_s, record: record, request: request)
|
|
38
38
|
|
|
39
39
|
if result.success?
|
|
40
40
|
render json: { message: I18n.t("verify_it.responses.verified") }, status: :ok
|
data/lib/verify_it/verifier.rb
CHANGED
|
@@ -30,7 +30,7 @@ module VerifyIt
|
|
|
30
30
|
finalize_send(to: to, record: record, channel: channel, code_data: code_data)
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
-
def verify_code(to:, code:, record:)
|
|
33
|
+
def verify_code(to:, code:, record:, request: nil)
|
|
34
34
|
rate_limit_result = check_verification_rate_limit(to: to, record: record)
|
|
35
35
|
return rate_limit_result if rate_limit_result
|
|
36
36
|
|
|
@@ -40,7 +40,7 @@ module VerifyIt
|
|
|
40
40
|
current_attempts = rate_limiter.record_verification_attempt(identifier: to, record: record)
|
|
41
41
|
|
|
42
42
|
if code_matches?(code, stored_code)
|
|
43
|
-
handle_verification_success(to: to, record: record, attempts: current_attempts)
|
|
43
|
+
handle_verification_success(to: to, record: record, attempts: current_attempts, request: request)
|
|
44
44
|
else
|
|
45
45
|
handle_verification_failure(to: to, record: record, attempts: current_attempts)
|
|
46
46
|
end
|
|
@@ -120,12 +120,12 @@ module VerifyIt
|
|
|
120
120
|
)
|
|
121
121
|
end
|
|
122
122
|
|
|
123
|
-
def handle_verification_success(to:, record:, attempts:)
|
|
123
|
+
def handle_verification_success(to:, record:, attempts:, request: nil)
|
|
124
124
|
storage.delete_code(identifier: to, record: record)
|
|
125
125
|
storage.reset_attempts(identifier: to, record: record)
|
|
126
126
|
storage.reset_send_count(identifier: to, record: record)
|
|
127
127
|
|
|
128
|
-
invoke_callback(config.on_verify_success, record: record, identifier: to)
|
|
128
|
+
invoke_callback(config.on_verify_success, record: record, identifier: to, request: request)
|
|
129
129
|
|
|
130
130
|
success_result("Verification successful", verified: true, attempts: attempts)
|
|
131
131
|
end
|
data/lib/verify_it/version.rb
CHANGED
data/lib/verify_it.rb
CHANGED
|
@@ -37,8 +37,8 @@ module VerifyIt
|
|
|
37
37
|
verifier.send_code(to: to, record: record, channel: channel, context: context)
|
|
38
38
|
end
|
|
39
39
|
|
|
40
|
-
def verify_code(to:, code:, record:)
|
|
41
|
-
verifier.verify_code(to: to, code: code, record: record)
|
|
40
|
+
def verify_code(to:, code:, record:, request: nil)
|
|
41
|
+
verifier.verify_code(to: to, code: code, record: record, request: request)
|
|
42
42
|
end
|
|
43
43
|
|
|
44
44
|
def cleanup(to:, record:)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: verify_it
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.1.beta
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jeremias Ramirez
|
|
@@ -193,12 +193,7 @@ files:
|
|
|
193
193
|
- lib/verify_it/verifiable.rb
|
|
194
194
|
- lib/verify_it/verifier.rb
|
|
195
195
|
- lib/verify_it/version.rb
|
|
196
|
-
- pkg/verify_it-0.1.0.gem
|
|
197
196
|
- sig/verify_it.rbs
|
|
198
|
-
- verify_it-0.1.0.gem
|
|
199
|
-
- verify_it-0.1.1.gem
|
|
200
|
-
- verify_it-0.2.0.gem
|
|
201
|
-
- verify_it-0.3.0.gem
|
|
202
197
|
homepage: https://github.com/JeremasPosta/verify_it
|
|
203
198
|
licenses:
|
|
204
199
|
- MIT
|
|
@@ -215,7 +210,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
215
210
|
requirements:
|
|
216
211
|
- - ">="
|
|
217
212
|
- !ruby/object:Gem::Version
|
|
218
|
-
version: '3.
|
|
213
|
+
version: '3.2'
|
|
219
214
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
220
215
|
requirements:
|
|
221
216
|
- - ">="
|
data/pkg/verify_it-0.1.0.gem
DELETED
|
Binary file
|
data/verify_it-0.1.0.gem
DELETED
|
Binary file
|
data/verify_it-0.1.1.gem
DELETED
|
Binary file
|
data/verify_it-0.2.0.gem
DELETED
|
Binary file
|
data/verify_it-0.3.0.gem
DELETED
|
Binary file
|