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
+7 -18
View File
@@ -36,7 +36,10 @@
{% endfor %}
<div class="auth-card">
<h2 class="auth-title">Sign In</h2>
<div class="auth-title-row">
<h2 class="auth-title">Sign In</h2>
<span class="auth-cap-badge"><i class="fas fa-shield-halved"></i> Protected by Cap</span>
</div>
<p class="auth-sub">Welcome back, commander</p>
{% if error %}
@@ -46,6 +49,8 @@
</div>
{% endif %}
<div data-cap-api-endpoint="{{ cap_api_endpoint }}" style="display: none;" aria-hidden="true"></div>
<form class="auth-form" method="post" action="{{ path('MineSeekerBundle_login') }}">
<input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}"/>
@@ -92,8 +97,6 @@
</p>
</div>
<input type="hidden" id="g-recaptcha-response" name="g-recaptcha-response"/>
<button type="submit" class="auth-submit">
<i class="fas fa-right-to-bracket"></i> Sign In
</button>
@@ -121,20 +124,6 @@
{% block javascripts %}
{{ parent() }}
<script src="https://www.google.com/recaptcha/api.js?render={{ recaptcha_site_key }}" async defer></script>
<script>
document.querySelector('.auth-form').addEventListener('submit', function (e) {
e.preventDefault();
const form = this;
grecaptcha.ready(function () {
grecaptcha.execute('{{ recaptcha_site_key }}', {action: 'login'}).then(function (token) {
document.getElementById('g-recaptcha-response').value = token;
form.submit();
});
});
});
</script>
{{ vite_entry_script_tags('cap') }}
{{ vite_entry_script_tags('passkey', { dependency: 'react' }) }}
{% endblock %}