From cf5bc51e94ce0138bddfd599d7dc7b0533f3fae2 Mon Sep 17 00:00:00 2001 From: Piyush Gupta <56182734+gupta-piyush19@users.noreply.github.com> Date: Tue, 6 May 2025 17:43:28 +0530 Subject: [PATCH] fix: strict recaptcha checks (#5674) --- apps/web/modules/ui/components/survey/index.tsx | 2 +- packages/js-core/src/lib/survey/widget.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/modules/ui/components/survey/index.tsx b/apps/web/modules/ui/components/survey/index.tsx index 6c6d83797a..34ee558476 100644 --- a/apps/web/modules/ui/components/survey/index.tsx +++ b/apps/web/modules/ui/components/survey/index.tsx @@ -51,7 +51,7 @@ export const SurveyInline = (props: Omit) = const loadScript = async () => { if (!window.formbricksSurveys) { try { - if (props.isSpamProtectionEnabled) { + if (props.isSpamProtectionEnabled && props.recaptchaSiteKey) { await loadRecaptchaScript(props.recaptchaSiteKey); } await loadSurveyScript(); diff --git a/packages/js-core/src/lib/survey/widget.ts b/packages/js-core/src/lib/survey/widget.ts index 5e42f93e66..c9f1e0e672 100644 --- a/packages/js-core/src/lib/survey/widget.ts +++ b/packages/js-core/src/lib/survey/widget.ts @@ -96,7 +96,7 @@ export const renderWidget = async ( return executeRecaptcha(recaptchaSiteKey); }; - if (isSpamProtectionEnabled) { + if (isSpamProtectionEnabled && recaptchaSiteKey) { await loadRecaptchaScript(recaptchaSiteKey); }