This commit is contained in:
jamz-uk authored and GitHub committed 2025-08-21 02:56:16 +01:00
1 parent f312a568a2
commit e507e1ac21
1 file changed
+10 -1
+10 -1
View File
@@ -1029,7 +1029,8 @@
const widgetId = window.turnstile.render(container, {
sitekey,
size: 'invisible',
// Allowed sizes: compact | normal | flexible
size: 'compact',
action,
retry: 'auto',
callback: (token) => {
@@ -1045,6 +1046,14 @@
}
});
this._turnstileWidgetId = widgetId;
// Manually execute after render for invisible-like behavior
try {
if (typeof window.turnstile?.execute === 'function') {
window.turnstile.execute(widgetId, { action });
}
} catch (execErr) {
console.warn('Turnstile execute after render failed (callback may still fire):', execErr);
}
} catch (e) {
reject(e);
}