add password complexity for instructeur, user and password change

This commit is contained in:
Lisa Durand 2024-09-03 16:59:53 +02:00
parent ae7971bdea
commit 00a155b896
No known key found for this signature in database
GPG key ID: 0DF91F2CA1E8B816
4 changed files with 19 additions and 22 deletions

View file

@ -18,14 +18,11 @@
.fr-fieldset__element
= render Dsfr::InputComponent.new(form: f, attribute: :password, input_type: :password_field,
opts: { autofocus: 'true', autocomplete: 'new-password', minlength: PASSWORD_MIN_LENGTH, data: { controller: populated_resource.validate_password_complexity? ? 'turbo-input' : false, turbo_input_url_value: show_password_complexity_path }}) do |c|
opts: { autofocus: 'true', autocomplete: 'new-password', minlength: PASSWORD_MIN_LENGTH, data: { controller: 'turbo-input', turbo_input_url_value: show_password_complexity_path }}) do |c|
- c.with_describedby do
- if populated_resource.validate_password_complexity?
%div{ id: c.describedby_id }
#password_complexity
= render PasswordComplexityComponent.new
- else
= render partial: "devise/password_rules", locals: { id: c.describedby_id }
%div{ id: c.describedby_id }
#password_complexity
= render PasswordComplexityComponent.new
.fr-fieldset__element
= render Dsfr::InputComponent.new(form: f, attribute: :password_confirmation, input_type: :password_field, opts: { autocomplete: 'new-password' })