- Issue created by @manoj.surala
- π«π·France jibus
Do you have the same behavior when using the dummy sitekeys and secret keys ?
https://developers.cloudflare.com/turnstile/reference/testing/
Here you should now see the Turnstile widget loading
Does the widget display a green check icon ?
- πΊπΈUnited States manoj.surala
Yes, It does display the Turnstile widget. Attached the successful load of widgets. I used the dummy keys as well and was able to load it successfully. What I don't understand is why the Image captcha widget or the default Captcha Math widget error comes on a page where turnstile is enabled. Below are my dev env details.
Drupal 7.97
PHP 8.1.27
Turnstile 7.x-1.0 - π«π·France jibus
Strange indeed.
Could you try to avoid setting Turnstile as default challenge for all forms and just enable it on the form you want (or one form for example)
Clear cache.
Doing that, do you have the same result ?
- πΊπΈUnited States manoj.surala
Yes, the settings were specific to those form types at the moment when I posted my results. I tried keeping turnstile for all forms earlier for the first time when I installed this module.
To avoid cache I used a different browser and also cleared the system cache tables to leave no stone unturned which gave me the same error unfortunately. I initially saw the widget loading fine but now seeing a message on the widget after I wait for a couple of seconds. Attached the screenshot. - πΊπΈUnited States manoj.surala
Yes, I reverted the keys back to the ones I created on Cloudflare for my dev site and it is normal again without any message from Cloudflare on the widget. The error still exists though. Unable to submit form and validation error pops up.
- π«π·France jibus
Apart from the php version, I have the same Drupal version and I don't have the generic error.
Do you have Watchdog ON ? What does it say ?
Below my conf :
Default challenge type : Math (from module captcha)
Turnstile is set as challenge type on specific form id (for example contact form)
Default challenge on non-listed forms : DISABLED
Add CAPTCHA administration links to forms : DISABLED
Allow CAPTCHAs and CAPTCHA administration links on administrative pages : DISABLED
Default CAPTCHA validation : Case insensitive validation: lowercase/uppercase errors are ignored.
Persistence: Omit challenges in a multi-step/preview workflow once the user successfully responds to a challenge.
Enable statistics : FALSE
Log wrong answer : FALSE - πΊπΈUnited States manoj.surala
My settings are the same but the "Default challenge: Image from Image Captcha Module" is enabled on few forms.
Watchdog errors:
Warning: Undefined array key "unknown-error" in Turnstile\Turnstile->getResponseErrors() (line 167 of /var/www/html/sites/all/modules/contrib/turnstile/src/Turnstile/Turnstile.php).forum_node_form post blocked by CAPTCHA module: challenge Turnstile (by module turnstile), user answered "Turnstile no captcha", but the solution was "1".
- π«π·France jibus
Looks like CF Turnstile return an unhandled error by the module.
From the module:
$error_codes = array( 'missing-input-secret' => t('The secret parameter was not passed.'), 'invalid-input-secret' => t('The secret parameter was invalid or did not exist.'), 'missing-input-response' => t('The response parameter was not passed.'), 'invalid-input-response' => t('The response parameter is invalid or has expired.'), 'bad-request' => t('The request was rejected because it was malformed.'), 'timeout-or-duplicate' => t('The response parameter has already been validated before.'), 'internal-error' => t('An internal error happened while validating the response. The request can be retried.'), );
https://developers.cloudflare.com/turnstile/get-started/server-side-vali...
missing-input-secret The secret parameter was not passed.
invalid-input-secret The secret parameter was invalid or did not exist.
missing-input-response The response parameter was not passed.
invalid-input-response The response parameter is invalid or has expired.
invalid-widget-id The widget ID extracted from the parsed site secret key was invalid or did not exist.
invalid-parsed-secret The secret extracted from the parsed site secret key was invalid.
bad-request The request was rejected because it was malformed.
timeout-or-duplicate The response parameter has already been validated before.
internal-error An internal error happened while validating the response. The request can be retried.So, it could be an invalid widget id or secret.
If you are in a dev env, you should only use dummy sitekey and secret.
- πΊπΈUnited States manoj.surala
But I the logs I shared are when I used dummy keys. I reverted back to dummy keys now and got the same logs again.
- π«π·France jibus
Does you dev env have access to internet and to the following URL ?
- πΊπΈUnited States manoj.surala
Thanks for pointing me in the right direction. Looks like this URL is blocked by the network team. I don't have access to test this on server level. But I did test dummy keys on a local env and it worked. Appreciate you for all the help Jibus :)
- Status changed to Closed: cannot reproduce
9 months ago 5:43pm 15 February 2024