invisible_captcha 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +5 -0
- data/README.md +4 -3
- data/lib/invisible_captcha/controller_ext.rb +8 -2
- data/lib/invisible_captcha/version.rb +1 -1
- 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: 0d931568dd6707074ae2b5f48f6a5552283d482a4d87f27b1c72852dfce3d9cb
|
4
|
+
data.tar.gz: 4e78f33d0a7c4be1a774de1e98e55d7fd2f7ff84e1a407d66a565c6e99779fa9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3fbe8b6755bbc31fb26fbf9d71f01b7c9dbe919feaaaf12f78f86f7e53e93bb9f04f52c83469ea59840714908d834abf84625a542e7f55de2b7f0cd1d877986c
|
7
|
+
data.tar.gz: 380701e4ddf138445faafb293ed94fe368d58eb7d995d44b3f871362550d5c2bb27d537d00c04cdf89501bc951ab227d3fe7c721389ba1f163327f4d8093ced4
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
|
5
|
+
## [1.1.0]
|
6
|
+
|
7
|
+
- New option `prepend: true` for the controller macro (#77)
|
8
|
+
|
5
9
|
## [1.0.1]
|
6
10
|
|
7
11
|
- Fix naming issue with Ruby 2.7 (#65)
|
@@ -115,6 +119,7 @@ All notable changes to this project will be documented in this file.
|
|
115
119
|
|
116
120
|
- First version of controller filters
|
117
121
|
|
122
|
+
[1.1.0]: https://github.com/markets/invisible_captcha/compare/v1.0.1...v1.1.0
|
118
123
|
[1.0.1]: https://github.com/markets/invisible_captcha/compare/v1.0.0...v1.0.1
|
119
124
|
[1.0.0]: https://github.com/markets/invisible_captcha/compare/v0.13.0...v1.0.0
|
120
125
|
[0.13.0]: https://github.com/markets/invisible_captcha/compare/v0.12.2...v0.13.0
|
data/README.md
CHANGED
@@ -55,9 +55,9 @@ class TopicsController < ApplicationController
|
|
55
55
|
|
56
56
|
private
|
57
57
|
|
58
|
-
|
59
|
-
|
60
|
-
|
58
|
+
def your_spam_callback_method
|
59
|
+
redirect_to root_path
|
60
|
+
end
|
61
61
|
end
|
62
62
|
```
|
63
63
|
|
@@ -153,6 +153,7 @@ The `invisible_captcha` method accepts some options:
|
|
153
153
|
- `timestamp_enabled`: enable/disable this technique at action level.
|
154
154
|
- `on_timestamp_spam`: custom callback to be called when form submitted too quickly. The default action redirects to `:back` printing a warning in `flash[:error]`.
|
155
155
|
- `timestamp_threshold`: custom threshold per controller/action. Overrides the global value for `InvisibleCaptcha.timestamp_threshold`.
|
156
|
+
- `prepend`: the spam detection will run in a `prepend_before_action` if `prepend: true`, otherwise will run in a `before_action`.
|
156
157
|
|
157
158
|
### View helpers options:
|
158
159
|
|
@@ -4,8 +4,14 @@ module InvisibleCaptcha
|
|
4
4
|
module ControllerExt
|
5
5
|
module ClassMethods
|
6
6
|
def invisible_captcha(options = {})
|
7
|
-
|
8
|
-
|
7
|
+
if options.key?(:prepend)
|
8
|
+
prepend_before_action(options) do
|
9
|
+
detect_spam(options)
|
10
|
+
end
|
11
|
+
else
|
12
|
+
before_action(options) do
|
13
|
+
detect_spam(options)
|
14
|
+
end
|
9
15
|
end
|
10
16
|
end
|
11
17
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: invisible_captcha
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marc Anguera Insa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|