cloudflare-turnstile-rails 1.3.0 → 1.3.1

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: 7bdf250ea2814264e89921898dcc1c38b968596fe59e9423914b2d245ee8607c
4
- data.tar.gz: e72026fff680a00cccfdb6134fbe9dafe0658abc8c135b0c5a4bc73404a1a104
3
+ metadata.gz: 6dc1ce72ca182df1b78145dbab630dcef8370c9feeb5889031fe816c77f28cc9
4
+ data.tar.gz: fbe98e296d6fd63bc73bcff534199c36b80c342042c25b7d5dab90af5552122d
5
5
  SHA512:
6
- metadata.gz: dfe05337cc155cd855b9297c8512d1c173069862a33f3061b685e41db3ec4ac7c20e86466d2c90d82d10795ccb0560b64177a344a5098885506efc53f614872d
7
- data.tar.gz: aa3d5dacc7e140dedf475881f61522480b30c87e39bf1b228999ed5244fbe33cf1f02af3ffa6575bc2e0a09acb78221375b2fe82863dfcf13274398bac631d3d
6
+ metadata.gz: b8fc81e538bbb4c131e8719a02910b83159fda9b21caf5faa89e97d6a561f801671c07ca14ccbe00e1dc0ff9575ee6e46adb6ec86b53c73acf620dacd1febf4b
7
+ data.tar.gz: d98429437a66c3f70ca2faf799c9683ceca875d64cfc04cf7699d86a87f11a7a113a160c131a2eccac064e705a5da081af5a8309fe65bccc5ead306b7979a422
data/README.md CHANGED
@@ -14,8 +14,6 @@ Supports **Rails 5.0 → latest** and **Ruby 2.6 → latest**, with the full Rai
14
14
  > [!TIP]
15
15
  > **Using Devise?** [devise-cloudflare-turnstile](https://github.com/vkononov/devise-cloudflare-turnstile) protects every Devise form (sign in, sign up, password reset, and more) with no changes to your Devise views or controllers. It is built on this gem and shares its configuration, so you can use both to protect Devise and non-Devise forms in the same app.
16
16
 
17
- [!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/yellow_img.png)](https://www.buymeacoffee.com/vkononov)
18
-
19
17
  ## Features
20
18
 
21
19
  * **One‑line integration**: `<%= cloudflare_turnstile_tag %>` in views, `valid_turnstile?(model:)` in controllers — no extra wiring.
@@ -47,10 +47,17 @@
47
47
  helper.nonce = nonce;
48
48
  }
49
49
 
50
+ // In implicit mode, Turnstile renders the initial page itself.
51
+ if ((/[?&]render=explicit(&|$)/).test(cfUrl)) {
52
+ helper.addEventListener('load', reinitializeTurnstile);
53
+ document.addEventListener('DOMContentLoaded', reinitializeTurnstile);
54
+ }
55
+
50
56
  document.head.appendChild(helper);
51
57
 
52
- // set up Turbo hooks only once
58
+ // set up navigation hooks only once
53
59
  document.addEventListener('turbo:render', reinitializeTurnstile);
60
+ document.addEventListener('turbolinks:load', reinitializeTurnstile);
54
61
  document.addEventListener('turbo:before-stream-render', function(event) {
55
62
  var orig = event.detail.render.bind(event.detail);
56
63
 
@@ -1,7 +1,7 @@
1
1
  module Cloudflare
2
2
  module Turnstile
3
3
  module Rails
4
- VERSION = '1.3.0'.freeze
4
+ VERSION = '1.3.1'.freeze
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudflare-turnstile-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vadim Kononov