diff --git a/.env.development b/.env.development index 227f789c7..3507ea7fc 100644 --- a/.env.development +++ b/.env.development @@ -31,4 +31,5 @@ REACT_APP_DOPPLER_MY_LANDINGS_URL=https://landingsqa.fromdoppler.net/choose-a-te REACT_APP_DOPPLER_CAN_BUY_CHAT_PLAN=true REACT_APP_DOPPLER_CONVERSATIONS_URL=https://conversationsqa.fromdoppler.net REACT_APP_USERPILOT_TOKEN=STG-NX-d04cfcac -REACT_APP_DOPPLER_CAN_BUY_ONSITE_PLAN=true \ No newline at end of file +REACT_APP_DOPPLER_CAN_BUY_ONSITE_PLAN=true +REACT_APP_DOPPLER_VALIDATE_CAPTCHA=false \ No newline at end of file diff --git a/.env.int b/.env.int index dcbe9f236..cd919defc 100644 --- a/.env.int +++ b/.env.int @@ -33,4 +33,5 @@ REACT_APP_DOPPLER_MY_LANDINGS_URL=https://landingsqa.fromdoppler.net/choose-a-te REACT_APP_DOPPLER_CAN_BUY_CHAT_PLAN=true REACT_APP_DOPPLER_CONVERSATIONS_URL=https://conversationsqa.fromdoppler.net REACT_APP_USERPILOT_TOKEN=STG-NX-d04cfcac -REACT_APP_DOPPLER_CAN_BUY_ONSITE_PLAN=true \ No newline at end of file +REACT_APP_DOPPLER_CAN_BUY_ONSITE_PLAN=true +REACT_APP_DOPPLER_VALIDATE_CAPTCHA=false \ No newline at end of file diff --git a/.env.production b/.env.production index 2abfed383..e3c782348 100644 --- a/.env.production +++ b/.env.production @@ -33,4 +33,5 @@ REACT_APP_DOPPLER_MY_LANDINGS_URL=https://landings.fromdoppler.com/choose-a-temp REACT_APP_DOPPLER_CAN_BUY_CHAT_PLAN=true REACT_APP_DOPPLER_CONVERSATIONS_URL=https://conversations.fromdoppler.com REACT_APP_USERPILOT_TOKEN=NX-d04cfcac -REACT_APP_DOPPLER_CAN_BUY_ONSITE_PLAN=false \ No newline at end of file +REACT_APP_DOPPLER_CAN_BUY_ONSITE_PLAN=false +REACT_APP_DOPPLER_VALIDATE_CAPTCHA=true \ No newline at end of file diff --git a/.env.qa b/.env.qa index 38cd6a99c..99e2cc0ea 100644 --- a/.env.qa +++ b/.env.qa @@ -33,4 +33,5 @@ REACT_APP_DOPPLER_MY_LANDINGS_URL=https://landingsqa.fromdoppler.net/choose-a-te REACT_APP_DOPPLER_CAN_BUY_CHAT_PLAN=true REACT_APP_DOPPLER_CONVERSATIONS_URL=https://conversationsqa.fromdoppler.net REACT_APP_USERPILOT_TOKEN=STG-NX-d04cfcac -REACT_APP_DOPPLER_CAN_BUY_ONSITE_PLAN=true \ No newline at end of file +REACT_APP_DOPPLER_CAN_BUY_ONSITE_PLAN=true +REACT_APP_DOPPLER_VALIDATE_CAPTCHA=false \ No newline at end of file diff --git a/src/components/form-helpers/form-helpers.js b/src/components/form-helpers/form-helpers.js index 5f44da57a..98792f9d1 100644 --- a/src/components/form-helpers/form-helpers.js +++ b/src/components/form-helpers/form-helpers.js @@ -106,7 +106,18 @@ const _FormWithCaptcha = ({ // See more details in https://stackoverflow.com/questions/43488605/detect-when-challenge-window-is-closed-for-google-recaptcha const captchaDelay = 100; createTimeout(() => formikProps.setSubmitting(false), captchaDelay); - const result = await verifyCaptcha(); + + const validateCaptcha = process.env.REACT_APP_DOPPLER_VALIDATE_CAPTCHA ?? 'true'; + let result = {}; + + if (validateCaptcha === 'true') { + result = await verifyCaptcha(); + } else { + result = { success: true, captchaResponseToken: 'hardcodedResponseToken' }; + } + + //await verifyCaptcha(); //{ success: true, captchaResponseToken: 'aaa'}; // + createTimeout(() => formikProps.setSubmitting(true), captchaDelay); if (result.success) { await originalOnSubmit(