chg: usr: replace Google ReCaptcha with Cap instance #13
This commit is contained in:
@@ -16,8 +16,12 @@
|
||||
{% block body %}
|
||||
<div class="auth-page">
|
||||
<div class="auth-card">
|
||||
<h2 class="auth-title">Reset Password</h2>
|
||||
<div class="auth-title-row">
|
||||
<h2 class="auth-title">Reset Password</h2>
|
||||
<span class="auth-cap-badge"><i class="fas fa-shield-halved"></i> Protected by Cap</span>
|
||||
</div>
|
||||
<p class="auth-sub">Choose a new password for your account</p>
|
||||
<div data-cap-api-endpoint="{{ cap_api_endpoint }}" style="display: none;" aria-hidden="true"></div>
|
||||
|
||||
{{ form_start(form, {attr: {class: 'auth-form'}}) }}
|
||||
|
||||
@@ -65,19 +69,5 @@
|
||||
|
||||
{% block javascripts %}
|
||||
{{ parent() }}
|
||||
<script src="https://www.google.com/recaptcha/api.js?render={{ recaptcha_site_key }}" async defer></script>
|
||||
<script>
|
||||
(function () {
|
||||
document.querySelector('.auth-form').addEventListener('submit', function (e) {
|
||||
e.preventDefault();
|
||||
const form = this;
|
||||
grecaptcha.ready(function () {
|
||||
grecaptcha.execute('{{ recaptcha_site_key }}', {action: 'reset_password'}).then(function (token) {
|
||||
document.getElementById('{{ form.recaptcha.vars.id }}').value = token;
|
||||
form.submit();
|
||||
});
|
||||
});
|
||||
});
|
||||
}());
|
||||
</script>
|
||||
{{ vite_entry_script_tags('cap') }}
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user