feat: Revert "feat: support reCAPTCHA v3 captcha provider" (#3135)

This reverts commit a0d6f2125e.
This commit is contained in:
Yang Luo
2024-08-20 17:56:53 +08:00
committed by GitHub
parent a0d6f2125e
commit b794ef87ee
3 changed files with 4 additions and 25 deletions

View File

@ -27,7 +27,7 @@ export const CaptchaWidget = (props) => {
useEffect(() => {
switch (captchaType) {
case "reCAPTCHA v2": {
case "reCAPTCHA": {
const reTimer = setInterval(() => {
if (!window.grecaptcha) {
loadScript("https://recaptcha.net/recaptcha/api.js");
@ -42,20 +42,6 @@ export const CaptchaWidget = (props) => {
}, 300);
break;
}
case "reCAPTCHA v3": {
const reTimer = setInterval(() => {
if (!window.grecaptcha) {
loadScript(`https://recaptcha.net/recaptcha/api.js?render=${siteKey}`);
}
if (window.grecaptcha && window.grecaptcha.execute) {
window.grecaptcha.execute(siteKey, {action: "submit"}).then(function(token) {
onChange(token);
});
clearInterval(reTimer);
}
}, 300);
break;
}
case "hCaptcha": {
const hTimer = setInterval(() => {
if (!window.hcaptcha) {