File tree Expand file tree Collapse file tree
resources/views/components/turnstile Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11
22@php ($nonce = \Illuminate \Support \Facades \Vite:: cspNonce () )
33
4+ <link rel =" preconnect" href =" https://challenges.cloudflare.com" />
45<script
56 id =" turnstile-script"
67 src =" https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit"
78 defer
9+ async
810 {{ $attributes -> merge ([' nonce' => $nonce ]) } }
911></script >
1012
Original file line number Diff line number Diff line change 2222 reset() {
2323 turnstile.reset(this.widgetId);
2424 },
25- init () {
25+ initCaptcha () {
2626 if($el.hasAttribute('data-invisible')) {
2727 this.load();
2828 } else {
5656 this.reset();
5757 }
5858 });
59+ },
60+ init() {
61+ if('turnstile' in window) {
62+ this.initCaptcha();
63+ } else {
64+ document.querySelector('#turnstile-script').addEventListener('load', () => this.initCaptcha());
65+ }
5966 }
6067 }"
6168 data-captcha
You can’t perform that action at this time.
0 commit comments