Private
Public Access
1
0

chg: usr: replace Google ReCaptcha with Cap instance #13

This commit is contained in:
2026-06-01 22:24:34 +02:00
parent 199bb7e525
commit 7063704539
24 changed files with 389 additions and 376 deletions
+6 -17
View File
@@ -34,8 +34,12 @@
</div>
{% else %}
<div class="auth-card">
<h2 class="auth-title">Forgot Password</h2>
<div class="auth-title-row">
<h2 class="auth-title">Forgot Password</h2>
<span class="auth-cap-badge"><i class="fas fa-shield-halved"></i> Protected by Cap</span>
</div>
<p class="auth-sub">Enter your email and we'll send you a reset link</p>
<div data-cap-api-endpoint="{{ cap_api_endpoint }}" style="display: none;" aria-hidden="true"></div>
{{ form_start(form, {attr: {class: 'auth-form'}}) }}
@@ -75,20 +79,5 @@
{% block javascripts %}
{{ parent() }}
<script src="https://www.google.com/recaptcha/api.js?render={{ recaptcha_site_key }}" async defer></script>
<script>
(function () {
const form = document.querySelector('.auth-form');
if (!form) return;
form.addEventListener('submit', function (e) {
e.preventDefault();
grecaptcha.ready(function () {
grecaptcha.execute('{{ recaptcha_site_key }}', {action: 'forgot_password'}).then(function (token) {
document.getElementById('{{ form.recaptcha.vars.id }}').value = token;
form.submit();
});
});
});
}());
</script>
{{ vite_entry_script_tags('cap') }}
{% endblock %}