You've already forked authentication-service
mirror of
https://github.com/matrix-org/matrix-authentication-service.git
synced 2025-08-07 17:03:01 +03:00
hCaptcha support
This commit is contained in:
@@ -132,6 +132,7 @@ pub fn captcha_config_from_config(
|
||||
mas_config::CaptchaServiceKind::CloudflareTurnstile => {
|
||||
mas_data_model::CaptchaService::CloudflareTurnstile
|
||||
}
|
||||
mas_config::CaptchaServiceKind::HCaptcha => mas_data_model::CaptchaService::HCaptcha,
|
||||
};
|
||||
|
||||
Ok(Some(mas_data_model::CaptchaConfig {
|
||||
|
@@ -27,6 +27,10 @@ pub enum CaptchaServiceKind {
|
||||
/// Use Cloudflare Turnstile
|
||||
#[serde(rename = "cloudflare_turnstile")]
|
||||
CloudflareTurnstile,
|
||||
|
||||
/// Use ``HCaptcha``
|
||||
#[serde(rename = "hcaptcha")]
|
||||
HCaptcha,
|
||||
}
|
||||
|
||||
/// Configuration section to setup CAPTCHA protection on a few operations
|
||||
|
@@ -20,6 +20,7 @@ use url::Url;
|
||||
pub enum CaptchaService {
|
||||
RecaptchaV2,
|
||||
CloudflareTurnstile,
|
||||
HCaptcha,
|
||||
}
|
||||
|
||||
/// Captcha configuration
|
||||
|
@@ -33,6 +33,7 @@ impl Object for CaptchaConfig {
|
||||
mas_data_model::CaptchaService::CloudflareTurnstile => {
|
||||
"cloudflare_turnstile".into()
|
||||
}
|
||||
mas_data_model::CaptchaService::HCaptcha => "hcaptcha".into(),
|
||||
}),
|
||||
Some("site_key") => Some(self.0.site_key.clone().into()),
|
||||
_ => None,
|
||||
|
Reference in New Issue
Block a user