Added password meter based on zxcvbn

Maybe we will use a different package later, as this one is very big...
This commit is contained in:
Jan Böhmer 2023-06-27 01:07:26 +02:00
parent 20826daa18
commit ecded8af93
7 changed files with 170 additions and 1 deletions

View file

@ -122,4 +122,22 @@
{% block part_select_widget %}
{{ form_widget(form.autocomplete) }}
{% endblock %}
{% block password_widget %}
{# If password_estimator setting is not set render it like normal #}
{% if password_estimator %}
<div {{ stimulus_controller('elements/password_strength_estimate') }}>
<div class="input-group">
<span class="input-group-text d-none">
<span class="badge badge-primary" {{ stimulus_target('elements/password_strength_estimate', 'badge') }}></span>
</span>
{{- parent() -}}
</div>
<span class="form-text text-warning" {{ stimulus_target('elements/password_strength_estimate', 'warning') }}></span>
</div>
{% else %}
{{- parent() -}}
{% endif %}
{% endblock %}