You've already forked authentication-service
mirror of
https://github.com/matrix-org/matrix-authentication-service.git
synced 2025-08-09 04:22:45 +03:00
Cloudflare Turnstile support
This commit is contained in:
@@ -14,10 +14,12 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
#}
|
||||
|
||||
{% macro form() -%}
|
||||
{% macro form(class="") -%}
|
||||
{%- if captcha|default(False) -%}
|
||||
{%- if captcha.service == "recaptcha_v2" -%}
|
||||
<div class="g-recaptcha" data-sitekey="{{ captcha.site_key }}"></div>
|
||||
<div class="g-recaptcha {{ class }}" data-sitekey="{{ captcha.site_key }}"></div>
|
||||
{%- elif captcha.service == "cloudflare_turnstile" -%}
|
||||
<div class="cf-turnstile {{ class }}" data-sitekey="{{ captcha.site_key }}"></div>
|
||||
{%- else -%}
|
||||
{{ throw(message="Invalid captcha service setup") }}
|
||||
{%- endif %}
|
||||
@@ -28,6 +30,8 @@ limitations under the License.
|
||||
{%- if captcha|default(False) -%}
|
||||
{%- if captcha.service == "recaptcha_v2" -%}
|
||||
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
|
||||
{%- elif captcha.service == "cloudflare_turnstile" -%}
|
||||
<script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer></script>
|
||||
{%- else -%}
|
||||
{{ throw(message="Invalid captcha service setup") }}
|
||||
{%- endif %}
|
||||
|
Reference in New Issue
Block a user