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

This reverts commit a0d6f2125ea2f376ac7f67861015b1fe1d0a4943.
This commit is contained in:
Yang Luo 2024-08-20 17:56:35 +08:00 committed by GitHub
parent a0d6f2125e
commit 4454dab8a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 25 deletions

View File

@ -24,9 +24,7 @@ func GetCaptchaProvider(captchaType string) CaptchaProvider {
switch captchaType {
case "Default":
return NewDefaultCaptchaProvider()
case "reCAPTCHA v2":
return NewReCaptchaProvider()
case "reCAPTCHA v3":
case "reCAPTCHA":
return NewReCaptchaProvider()
case "Aliyun Captcha":
return NewAliyunCaptchaProvider()

View File

@ -279,11 +279,7 @@ export const OtherProviderInfo = {
logo: `${StaticBaseUrl}/img/captcha_default.png`,
url: "https://pkg.go.dev/github.com/dchest/captcha",
},
"reCAPTCHA v2": {
logo: `${StaticBaseUrl}/img/social_recaptcha.png`,
url: "https://www.google.com/recaptcha",
},
"reCAPTCHA v3": {
"reCAPTCHA": {
logo: `${StaticBaseUrl}/img/social_recaptcha.png`,
url: "https://www.google.com/recaptcha",
},
@ -1087,8 +1083,7 @@ export function getProviderTypeOptions(category) {
} else if (category === "Captcha") {
return ([
{id: "Default", name: "Default"},
{id: "reCAPTCHA v2", name: "reCAPTCHA v2"},
{id: "reCAPTCHA v3", name: "reCAPTCHA v3"},
{id: "reCAPTCHA", name: "reCAPTCHA"},
{id: "hCaptcha", name: "hCaptcha"},
{id: "Aliyun Captcha", name: "Aliyun Captcha"},
{id: "GEETEST", name: "GEETEST"},

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) {