diff --git a/vendor/magento/module-re-captcha-customer/Plugin/Customer/DisableCreateAccountButton.php b/vendor/magento/module-re-captcha-customer/Plugin/Customer/DisableCreateAccountButton.php new file mode 100644 index 00000000..ea6e3ebc --- /dev/null +++ b/vendor/magento/module-re-captcha-customer/Plugin/Customer/DisableCreateAccountButton.php @@ -0,0 +1,46 @@ +isCaptchaEnabled = $isCaptchaEnabled; + } + + /** + * Temporally disable button Create Account while captcha is loading + * + * @param CreateAccountButton $subject + * @return bool + * @throws InputException + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function afterDisabled(CreateAccountButton $subject): bool + { + $key = 'customer_create'; + return $this->isCaptchaEnabled->isCaptchaEnabledFor($key); + } +} diff --git a/vendor/magento/module-re-captcha-customer/Plugin/Customer/DisableLoginButton.php b/vendor/magento/module-re-captcha-customer/Plugin/Customer/DisableLoginButton.php new file mode 100644 index 00000000..b0713fa3 --- /dev/null +++ b/vendor/magento/module-re-captcha-customer/Plugin/Customer/DisableLoginButton.php @@ -0,0 +1,47 @@ +isCaptchaEnabled = $isCaptchaEnabled; + } + + /** + * Temporally disable Login button while captcha is loading + * + * @param LoginButton $subject + * @return bool + * @throws InputException + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function afterDisabled(LoginButton $subject): bool + { + $key = 'customer_login'; + return $this->isCaptchaEnabled->isCaptchaEnabledFor($key); + } +} diff --git a/vendor/magento/module-re-captcha-customer/etc/frontend/di.xml b/vendor/magento/module-re-captcha-customer/etc/frontend/di.xml index 1d090238..de5be017 100644 --- a/vendor/magento/module-re-captcha-customer/etc/frontend/di.xml +++ b/vendor/magento/module-re-captcha-customer/etc/frontend/di.xml @@ -20,5 +20,12 @@ - + + + + + + diff --git a/vendor/magento/module-re-captcha-frontend-ui/view/frontend/web/js/reCaptcha.js b/vendor/magento/module-re-captcha-frontend-ui/view/frontend/web/js/reCaptcha.js index 9528f06e..14f2af32 100644 --- a/vendor/magento/module-re-captcha-frontend-ui/view/frontend/web/js/reCaptcha.js +++ b/vendor/magento/module-re-captcha-frontend-ui/view/frontend/web/js/reCaptcha.js @@ -174,6 +174,7 @@ define( } else { this.tokenField = null; } + if ($('#send2').length > 0) {$('#send2').prop('disabled', false);} }, /**