mirror of
https://github.com/element-hq/matrix-authentication-service.git
synced 2026-08-15 13:19:46 +00:00
Instead of provider-specific markup and script tags in the head, the captcha.form() template macro now emits a placeholder element carrying the CAPTCHA configuration in data attributes, on which a new entrypoint mounts the React Captcha component. The widget still injects its hidden response field inside the form, so the server-side verification flow is unchanged. This is the first use of inline React components to progressively enhance server-rendered pages.
22 lines
697 B
HTML
22 lines
697 B
HTML
{#
|
|
Copyright 2025, 2026 Element Creations Ltd.
|
|
Copyright 2024, 2025 New Vector Ltd.
|
|
Copyright 2024 The Matrix.org Foundation C.I.C.
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
|
Please see LICENSE files in the repository root for full details.
|
|
-#}
|
|
|
|
{% macro form(class="") -%}
|
|
{%- if captcha_config|default(False) -%}
|
|
<noscript>
|
|
<div class="captcha-noscript">
|
|
{{ _("mas.captcha.noscript") }}
|
|
</div>
|
|
</noscript>
|
|
|
|
{{ include_asset('src/entrypoints/captcha.tsx') }}
|
|
<div class="{{ class }}" data-captcha-service="{{ captcha_config.service }}" data-captcha-site-key="{{ captcha_config.site_key }}"></div>
|
|
{%- endif -%}
|
|
{% endmacro %}
|