{% extends 'admin/base_login.html.twig' %}
{% block stylesheets %}
<script src="https://www.google.com/recaptcha/api.js?render={{ recaptcha_site_key }}" async defer></script>
<script>
function executeRecaptcha() {
grecaptcha.ready(function() {
grecaptcha.execute('{{ recaptcha_site_key }}', {action: 'submit'}).then(function(token) {
// Dodaj token do ukrytego pola input w formularzu
document.getElementById('g-recaptcha-response').value = token;
});
});
}
window.onload = executeRecaptcha;
</script>
{% endblock %}
{% block title %}Reset password{% endblock %}
{% block body %}
<div class="card">
<div class="card-header text-white text-center">
<h4>Reset Password</h4>
</div>
<div class="card-body">
{% if success %}
<div class="alert alert-success">{{ success }}</div>
<p>You should recieve a verification link to set a new password. Check Your mailbox..</p>
{% else %}
{% if custom_error %}
<div class="alert alert-danger">{{ custom_error }}</div>
{% endif %}
{% for flash_error in app.flashes('verify_email_error') %}
<div class="alert alert-danger" role="alert">{{ flash_error }}</div>
{% endfor %}
{{ form_start(requestResetPasswordForm) }}
<div class="form-group">
{{ form_row(requestResetPasswordForm.email, { 'attr': {'class': 'form-control', 'autocomplete': 'email' }} ) }}
</div>
<input type="hidden" name="g-recaptcha-response" id="g-recaptcha-response">
<button type="submit" class="btn btn-purple btn-block">Send email</button>
<p>Already have an account? <a href="/login">Log in.</a></p>
<p>You'll recieve a verification link to set a new password if the account exists and it's verified.</p>
{{ form_end(requestResetPasswordForm) }}
{% endif %}
</div>
</div>
{% endblock %}