recaptcha 5.15.0 → 5.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +3 -2
- data/lib/recaptcha/helpers.rb +3 -3
- data/lib/recaptcha/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: 66a204367215f4ea083958e3f322fc7f2955e7481c09a5cadb1f57cf3acd187e
|
4
|
+
data.tar.gz: b6e7c0417b4d81bd0e7f15f7837968fbf65096e5d4a6286e297f1bbc030b7744
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c9162ae165cfb00d6ed03f91ef832e90e6bc357cfc31ee71a1a52311910fb183eb40a50967fa04f729243924c1fc9defad7d2030353ccc895b31e7bdb28e210
|
7
|
+
data.tar.gz: 8da70c71cb13ce29d7ddfa956795dc2bdcff53ea8aeaa64ad6495e5b4cfa40d82bfd90d9870220173a955e095346ba8f6e451364278af5887e4360b6d5601e07
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -419,7 +419,7 @@ but only accepts the following options:
|
|
419
419
|
| Option | Description |
|
420
420
|
|---------------------|-------------|
|
421
421
|
| `:site_key` | Override site API key |
|
422
|
-
| `:action` | The name of the [reCAPTCHA action](https://developers.google.com/recaptcha/docs/v3#actions). Actions may only contain alphanumeric characters and
|
422
|
+
| `:action` | The name of the [reCAPTCHA action](https://developers.google.com/recaptcha/docs/v3#actions). Actions are not case-sensitive and may only contain alphanumeric characters, slashes, and underscores, and must not be user-specific. |
|
423
423
|
| `:nonce` | Optional. Sets nonce attribute for script. Can be generated via `SecureRandom.base64(32)`. (default: `nil`) |
|
424
424
|
| `:callback` | Name of callback function to call with the token. When `element` is `:input`, this defaults to a function named `setInputWithRecaptchaResponseTokenFor#{sanitize_action(action)}` that sets the value of the hidden input to the token. |
|
425
425
|
| `:id` | Specify a unique `id` attribute for the `<input>` element if using `element: :input`. (default: `"g-recaptcha-response-data-"` + `action`) |
|
@@ -427,7 +427,8 @@ but only accepts the following options:
|
|
427
427
|
| `:script` | Same as setting both `:inline_script` and `:external_script`. (default: `true`). |
|
428
428
|
| `:inline_script` | If `true`, adds an inline script tag that calls `grecaptcha.execute` for the given `site_key` and `action` and calls the `callback` with the resulting response token. Pass `false` if you want to handle calling `grecaptcha.execute` yourself. (default: `true`) |
|
429
429
|
| `:element` | The element to render, if any (default: `:input`)<br/>`:input`: Renders a hidden `<input type="hidden">` tag. The value of this will be set to the response token by the default `setInputWithRecaptchaResponseTokenFor{action}` callback.<br/>`false`: Doesn't render any tag. You'll have to add a custom callback that does something with the token. |
|
430
|
-
| `:
|
430
|
+
| `:turbo` | If `true`, calls the js function which executes reCAPTCHA after all the dependencies have been loaded. This cannot be used with the js param `:onload`. This makes reCAPTCHAv3 usable with turbo. |
|
431
|
+
| `:turbolinks` | Alias of `:turbo`. Will be deprecated soon. |
|
431
432
|
| `:ignore_no_element` | If `true`, adds null element checker for forms that can be removed from the page by javascript like modals with forms. (default: true) |
|
432
433
|
|
433
434
|
[JavaScript resource (api.js) parameters](https://developers.google.com/recaptcha/docs/invisible#js_param):
|
data/lib/recaptcha/helpers.rb
CHANGED
@@ -12,7 +12,7 @@ module Recaptcha
|
|
12
12
|
action = options.delete(:action) || raise(Recaptcha::RecaptchaError, 'action is required')
|
13
13
|
id = options.delete(:id) || "g-recaptcha-response-data-#{dasherize_action(action)}"
|
14
14
|
name = options.delete(:name) || "g-recaptcha-response-data[#{action}]"
|
15
|
-
|
15
|
+
turbo = options.delete(:turbo) || options.delete(:turbolinks)
|
16
16
|
options[:render] = site_key
|
17
17
|
options[:script_async] ||= false
|
18
18
|
options[:script_defer] ||= false
|
@@ -24,11 +24,11 @@ module Recaptcha
|
|
24
24
|
end
|
25
25
|
options[:class] = "g-recaptcha-response #{options[:class]}"
|
26
26
|
|
27
|
-
if
|
27
|
+
if turbo
|
28
28
|
options[:onload] = recaptcha_v3_execute_function_name(action)
|
29
29
|
end
|
30
30
|
html, tag_attributes = components(options)
|
31
|
-
if
|
31
|
+
if turbo
|
32
32
|
html << recaptcha_v3_onload_script(site_key, action, callback, id, options)
|
33
33
|
elsif recaptcha_v3_inline_script?(options)
|
34
34
|
html << recaptcha_v3_inline_script(site_key, action, callback, id, options)
|
data/lib/recaptcha/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: recaptcha
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.16.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason L Perry
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mocha
|