verbb / formie

The most user-friendly forms plugin for Craft CMS.
Other
93 stars 68 forks source link

Recaptcha Entreprise integration has a new config field breaking existing integrations #1896

Closed uandco closed 1 month ago

uandco commented 1 month ago

Describe the bug

The older versions of Formie used to have a reCAPTCHA Site Key and reCAPTCHA Secret Key fields to configure ReCaptcha Entreprise.

Now there's a new Google Console API Key field which needs to be populated when updating the plugin, otherwise existing reCaptcha integrations break as they don't send the key anymore (which was taken from the reCAPTCHA Secret Key field), resulting in a 403 from the ReCaptcha API when submitting a form.

I used to use the API key in the reCAPTCHA Secret Key field. It turns out using the same value for reCAPTCHA Secret Key and Google Console API Key is the only way to configure the integration now, as reCAPTCHA Secret Key is mandatory but shouldn't even exist for ReCaptcha Entreprise, as it's only relevant for v3.

Steps to reproduce

See above

Form settings

Craft CMS version

Craft Pro 4.9.4

Plugin version

2.1.15

Multi-site?

No

Additional context

Imho, reCAPTCHA Secret Key should have been renamed to Google Console API Key, but still use the old config name, or a proper migration needs to be in place.

The fact reCAPTCHA Secret Key also remains is confusing as there's no secret in ReCaptcha Entreprise.

engram-design commented 1 month ago

Fixed for the next release. To get this early, run composer require verbb/formie:"dev-craft-4 as 2.1.15". This will handle using the API Key setting or not. It's now been removed and we're back to the "Secret Key", although it's been visually renamed.

As for removing "reCAPTCHA Secret Key" or even renaming it - the reason that hasn't been done is due to the limitation of how Craft's toggle-field behaviour works. For now, I'm just doing something manual to change the label for clarity.

engram-design commented 1 month ago

Fixed in 2.1.16