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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: addd45d783c834ffbc2253f3b7df793762ffb839617315d6cfd17e7d5abec519
4
- data.tar.gz: 1795b9d183326d23f408b5dd2b595531ff504885797012aa51953c6efc73a29d
3
+ metadata.gz: 66a204367215f4ea083958e3f322fc7f2955e7481c09a5cadb1f57cf3acd187e
4
+ data.tar.gz: b6e7c0417b4d81bd0e7f15f7837968fbf65096e5d4a6286e297f1bbc030b7744
5
5
  SHA512:
6
- metadata.gz: ddccc592d5d0ecdf7bae96d6a68ea29085dcdbfad9b346ae761a50d8b5b4c9f5337946e4e4374af4a1f74a2d8efd1e90e7a517f933f89f71a0cf3a1add44e701
7
- data.tar.gz: 9b3fc098f10c2a53798adaebca95b60a0e54b6188275dd388afd3fb160ff881caf7724e57c9063478c08d7b8e3f268e952aefc413bf2e3e2ab4bdf7c13a4b0a4
6
+ metadata.gz: 2c9162ae165cfb00d6ed03f91ef832e90e6bc357cfc31ee71a1a52311910fb183eb40a50967fa04f729243924c1fc9defad7d2030353ccc895b31e7bdb28e210
7
+ data.tar.gz: 8da70c71cb13ce29d7ddfa956795dc2bdcff53ea8aeaa64ad6495e5b4cfa40d82bfd90d9870220173a955e095346ba8f6e451364278af5887e4360b6d5601e07
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  ## Next
2
2
 
3
+ ## 5.16.0
4
+ * Allow usage of `options[:turbo]` as well as `options[:turbolinks]` for `recaptcha_v3`
5
+
3
6
  ## 5.15.0
4
7
  * Add 3.2 to the list of Ruby CI versions
5
8
  * Add ability to submit verify_recaptcha via POST with JSON Body with `options[:json] = true`
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 slashes, and must not be user-specific. |
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
- | `:turbolinks` | 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 turbolinks. |
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):
@@ -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
- turbolinks = options.delete(:turbolinks)
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 turbolinks
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 turbolinks
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)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Recaptcha
4
- VERSION = '5.15.0'
4
+ VERSION = '5.16.0'
5
5
  end
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.15.0
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-08-19 00:00:00.000000000 Z
11
+ date: 2023-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mocha