Module doesn't work with wrong password

Created on 11 September 2024, 2 months ago

Problem/Motivation

When you try to use this module, you set a wrong password and, exception is throw but not catch and drupal crash.
AND it's write "This user bypasses the password policy." but it's not the case.

Drupal\Core\Entity\EntityStorageException: The password must satisfy the following password policy rules: <!-- THEME DEBUG --> <!-- THEME HOOK: 'item_list' --> <!-- BEGIN OUTPUT from 'themes/contrib/bootstrap5/templates/dataset/item-list.html.twig' --> <div class="item-list"><ul><li class="password-policy-valid-rule">Must be at least 1 character long.</li><li class="password-policy-invalid-rule marker">Must contain at least 1 lowercase character.</li><li class="password-policy-invalid-rule marker">Must contain at least 1 uppercase character.</li><li class="password-policy-invalid-rule marker">Must contain at least 1 special character.</li><li class="password-policy-valid-rule">Must contain at least 1 numeric character.</li></ul></div> <!-- END OUTPUT from 'themes/contrib/bootstrap5/templates/dataset/item-list.html.twig' --> in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 817 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).

Drupal\Core\Field\FieldItemList->delegateMethod('preSave') (Line: 191)
Drupal\Core\Field\FieldItemList->preSave() (Line: 938)
Drupal\Core\Entity\ContentEntityStorageBase->invokeFieldMethod('preSave', Object) (Line: 888)
Drupal\Core\Entity\ContentEntityStorageBase->invokeHook('presave', Object) (Line: 529)
Drupal\Core\Entity\EntityStorageBase->doPreSave(Object) (Line: 753)
Drupal\Core\Entity\ContentEntityStorageBase->doPreSave(Object) (Line: 483)
Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 806)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object) (Line: 339)
Drupal\Core\Entity\EntityBase->save() (Line: 100)

Steps to reproduce

- 1 install the module
- 2 go to user/register OR admin/people/create
- 3 try a password does match with valdiation
- 4 throw exeption and drupal crash

Proposed resolution

- no idea at this time -

🐛 Bug report
Status

Needs work

Version

1.0

Component

Code

Created by

🇫🇷France julfabre

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024