diff --git a/crates/templates/src/context/captcha.rs b/crates/templates/src/context/captcha.rs index f9d8723b4..f2139e2bd 100644 --- a/crates/templates/src/context/captcha.rs +++ b/crates/templates/src/context/captcha.rs @@ -1,3 +1,4 @@ +// Copyright 2025, 2026 Element Creations Ltd. // Copyright 2024, 2025 New Vector Ltd. // Copyright 2024 The Matrix.org Foundation C.I.C. // @@ -42,7 +43,7 @@ impl Object for CaptchaConfig { /// Context with an optional CAPTCHA configuration in it #[derive(Serialize)] pub struct WithCaptcha { - captcha: Option, + captcha_config: Option, #[serde(flatten)] inner: T, @@ -52,7 +53,7 @@ impl WithCaptcha { #[must_use] pub(crate) fn new(captcha: Option, inner: T) -> Self { Self { - captcha: captcha.map(|captcha| Value::from_object(CaptchaConfig(captcha))), + captcha_config: captcha.map(|captcha| Value::from_object(CaptchaConfig(captcha))), inner, } } diff --git a/templates/components/captcha.html b/templates/components/captcha.html index 42b5e12b2..45fbf9bcb 100644 --- a/templates/components/captcha.html +++ b/templates/components/captcha.html @@ -7,19 +7,19 @@ Please see LICENSE files in the repository root for full details. -#} {% macro form(class="") -%} - {%- if captcha|default(False) -%} + {%- if captcha_config|default(False) -%} - {%- if captcha.service == "recaptcha_v2" -%} -
- {%- elif captcha.service == "cloudflare_turnstile" -%} -
- {%- elif captcha.service == "hcaptcha" -%} -
+ {%- if captcha_config.service == "recaptcha_v2" -%} +
+ {%- elif captcha_config.service == "cloudflare_turnstile" -%} +
+ {%- elif captcha_config.service == "hcaptcha" -%} +
{%- else -%} {{ throw(message="Invalid captcha service setup") }} {%- endif %} @@ -27,12 +27,12 @@ Please see LICENSE files in the repository root for full details. {% endmacro %} {% macro head() -%} - {%- if captcha|default(False) -%} - {%- if captcha.service == "recaptcha_v2" -%} + {%- if captcha_config|default(False) -%} + {%- if captcha_config.service == "recaptcha_v2" -%} - {%- elif captcha.service == "cloudflare_turnstile" -%} + {%- elif captcha_config.service == "cloudflare_turnstile" -%} - {%- elif captcha.service == "hcaptcha" -%} + {%- elif captcha_config.service == "hcaptcha" -%} {%- else -%} {{ throw(message="Invalid captcha service setup") }}