mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 02:35:49 +08:00
Revert "feat: support reCAPTCHA v3 captcha provider (#3130)"
This reverts commit a0d6f2125ea2f376ac7f67861015b1fe1d0a4943.
This commit is contained in:
parent
a0d6f2125e
commit
4454dab8a1
@ -24,9 +24,7 @@ func GetCaptchaProvider(captchaType string) CaptchaProvider {
|
|||||||
switch captchaType {
|
switch captchaType {
|
||||||
case "Default":
|
case "Default":
|
||||||
return NewDefaultCaptchaProvider()
|
return NewDefaultCaptchaProvider()
|
||||||
case "reCAPTCHA v2":
|
case "reCAPTCHA":
|
||||||
return NewReCaptchaProvider()
|
|
||||||
case "reCAPTCHA v3":
|
|
||||||
return NewReCaptchaProvider()
|
return NewReCaptchaProvider()
|
||||||
case "Aliyun Captcha":
|
case "Aliyun Captcha":
|
||||||
return NewAliyunCaptchaProvider()
|
return NewAliyunCaptchaProvider()
|
||||||
|
@ -279,11 +279,7 @@ export const OtherProviderInfo = {
|
|||||||
logo: `${StaticBaseUrl}/img/captcha_default.png`,
|
logo: `${StaticBaseUrl}/img/captcha_default.png`,
|
||||||
url: "https://pkg.go.dev/github.com/dchest/captcha",
|
url: "https://pkg.go.dev/github.com/dchest/captcha",
|
||||||
},
|
},
|
||||||
"reCAPTCHA v2": {
|
"reCAPTCHA": {
|
||||||
logo: `${StaticBaseUrl}/img/social_recaptcha.png`,
|
|
||||||
url: "https://www.google.com/recaptcha",
|
|
||||||
},
|
|
||||||
"reCAPTCHA v3": {
|
|
||||||
logo: `${StaticBaseUrl}/img/social_recaptcha.png`,
|
logo: `${StaticBaseUrl}/img/social_recaptcha.png`,
|
||||||
url: "https://www.google.com/recaptcha",
|
url: "https://www.google.com/recaptcha",
|
||||||
},
|
},
|
||||||
@ -1087,8 +1083,7 @@ export function getProviderTypeOptions(category) {
|
|||||||
} else if (category === "Captcha") {
|
} else if (category === "Captcha") {
|
||||||
return ([
|
return ([
|
||||||
{id: "Default", name: "Default"},
|
{id: "Default", name: "Default"},
|
||||||
{id: "reCAPTCHA v2", name: "reCAPTCHA v2"},
|
{id: "reCAPTCHA", name: "reCAPTCHA"},
|
||||||
{id: "reCAPTCHA v3", name: "reCAPTCHA v3"},
|
|
||||||
{id: "hCaptcha", name: "hCaptcha"},
|
{id: "hCaptcha", name: "hCaptcha"},
|
||||||
{id: "Aliyun Captcha", name: "Aliyun Captcha"},
|
{id: "Aliyun Captcha", name: "Aliyun Captcha"},
|
||||||
{id: "GEETEST", name: "GEETEST"},
|
{id: "GEETEST", name: "GEETEST"},
|
||||||
|
@ -27,7 +27,7 @@ export const CaptchaWidget = (props) => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
switch (captchaType) {
|
switch (captchaType) {
|
||||||
case "reCAPTCHA v2": {
|
case "reCAPTCHA": {
|
||||||
const reTimer = setInterval(() => {
|
const reTimer = setInterval(() => {
|
||||||
if (!window.grecaptcha) {
|
if (!window.grecaptcha) {
|
||||||
loadScript("https://recaptcha.net/recaptcha/api.js");
|
loadScript("https://recaptcha.net/recaptcha/api.js");
|
||||||
@ -42,20 +42,6 @@ export const CaptchaWidget = (props) => {
|
|||||||
}, 300);
|
}, 300);
|
||||||
break;
|
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": {
|
case "hCaptcha": {
|
||||||
const hTimer = setInterval(() => {
|
const hTimer = setInterval(() => {
|
||||||
if (!window.hcaptcha) {
|
if (!window.hcaptcha) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user