excelwebzone / EWZRecaptchaBundle

This bundle provides easy reCAPTCHA form field for Symfony.
MIT License
396 stars 160 forks source link

Having multiple forms with V3 recaptcha overwrites global js variables #290

Open FluffyDiscord opened 2 years ago

FluffyDiscord commented 2 years ago

I have multiple forms on page that use V3 validation. The issue is, that for every form, the widget outputs <script> which contains globally defined variables such as grecaptchaInput or grecaptchaForm which are being overwritten with each new form in page.

The solution is either use local vars, such as let or const or add random prefix to them when generating the widget script.