feat: support configurable captcha(reCaptcha & hCaptcha) (#765)

* feat: support configurable captcha(layered architecture)

* refactor & add captcha logo

* rename captcha

* Update authz.go

* Update hcaptcha.go

* Update default.go

* Update recaptcha.go

Co-authored-by: Gucheng <85475922+nomeguy@users.noreply.github.com>
This commit is contained in:
Resulte Lee
2022-06-18 16:00:31 +08:00
committed by GitHub
parent ae4ab9902b
commit 2e42511bc4
25 changed files with 687 additions and 72 deletions

View File

@ -106,6 +106,20 @@ export const OtherProviderInfo = {
url: "https://gc.org"
},
},
Captcha: {
"Default": {
logo: `${StaticBaseUrl}/img/social_default.png`,
url: "https://pkg.go.dev/github.com/dchest/captcha",
},
"reCAPTCHA": {
logo: `${StaticBaseUrl}/img/social_recaptcha.png`,
url: "https://www.google.com/recaptcha",
},
"hCaptcha": {
logo: `${StaticBaseUrl}/img/social_hcaptcha.png`,
url: "https://www.hcaptcha.com",
}
}
};
export function getCountryRegionData() {
@ -595,6 +609,12 @@ export function getProviderTypeOptions(category) {
{id: 'PayPal', name: 'PayPal'},
{id: 'GC', name: 'GC'},
]);
} else if (category === "Captcha") {
return ([
{id: 'Default', name: 'Default'},
{id: 'reCAPTCHA', name: 'reCAPTCHA'},
{id: 'hCaptcha', name: 'hCaptcha'},
]);
} else {
return [];
}