Skip to content

Commit 6644ca3

Browse files
committed
...
1 parent d10a2ab commit 6644ca3

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

src/components/SubscribeBox.svelte

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,6 @@
7575
}
7676
}
7777
78-
// Check if form was filled too quickly (likely bot)
79-
function isFormTooFast() {
80-
const timeElapsed = Date.now() - formStartTime;
81-
return timeElapsed < 3000; // Less than 3 seconds is suspicious
82-
}
83-
8478
// Validate form submission
8579
function validateForm(event) {
8680
const target = event.target;
@@ -94,15 +88,13 @@
9488
return false;
9589
}
9690
97-
// Check if form was submitted too quickly
9891
if (isFormTooFast()) {
9992
event.preventDefault();
10093
console.log('Bot detectado: formulario enviado muy rápido');
10194
alert('Por favor, espera unos segundos antes de enviar el formulario.');
10295
return false;
10396
}
10497
105-
// Check Turnstile (if enabled)
10698
console.log('Verificando respuesta de Turnstile:', turnstileResponse);
10799
console.log('ID del widget de Turnstile:', turnstileWidgetId);
108100
console.log('isTurnstileLoaded:', isTurnstileLoaded);
@@ -113,7 +105,6 @@
113105
return false;
114106
}
115107
116-
// If validation passes, allow form submission to Brevo
117108
console.log('Validación del formulario pasada, enviando a Brevo');
118109
return true;
119110
}
@@ -180,21 +171,16 @@
180171
</button>
181172
</div>
182173

183-
<!-- Cloudflare Turnstile Container -->
184174
<div id="turnstile-container" class="flex justify-center"></div>
185175

186-
<!-- Honeypot fields for spam prevention -->
187176
<div style="position: absolute; left: -5000px;" aria-hidden="true">
188-
<!-- Original honeypot -->
189177
<input
190178
type="text"
191179
name="b_6a37b9b668c1da15bcc718fa4_203574be23"
192180
tabindex="-1"
193181
value=""
194182
/>
195-
<!-- Additional honeypot field -->
196183
<input type="text" name="website" tabindex="-1" value="" autocomplete="off" />
197-
<!-- Time-based validation field -->
198184
<input type="hidden" name="form_time" value={formStartTime} />
199185
</div>
200186
</div>

0 commit comments

Comments
 (0)