fix: implement password change for shop customers

The password change form on the profile page (``Mes coordonnées``)
was scaffolded but never wired to any backend logic. The fields
``current-password``, ``new-password`` and ``new-password_confirmation``
were silently ignored by ``Customers::storeFull()``.

- Add ``handlePasswordChange()`` in ``CustomerController`` that
  validates current password, confirmation match, and 8-char minimum
  before hashing and saving.
- Remove ``required`` attribute from password fields so the form can
  submit for profile-only updates without filling password fields.
- Strip password fields from request data before passing to
  ``storeFull()`` to avoid Eloquent mass-assignment noise.
This commit is contained in:
Valentin Lab
2026-02-09 08:36:29 +01:00
parent 4fbbe991d9
commit ed3909782b
2 changed files with 47 additions and 3 deletions

View File

@@ -13,7 +13,7 @@
<label for="new-password" class="col-md-6 control-label text-right">Nouveau mot de passe</label>
<div class="col-md-6">
<input id="new-password" type="password" class="form-control" name="new-password" required>
<input id="new-password" type="password" class="form-control" name="new-password">
</div>
</div>
@@ -21,6 +21,6 @@
<label for="new-password-confirm" class="col-md-6 control-label text-right">Confirmez votre mot de passe</label>
<div class="col-md-6">
<input id="new-password-confirm" type="password" class="form-control" name="new-password_confirmation" required>
<input id="new-password-confirm" type="password" class="form-control" name="new-password_confirmation">
</div>
</div>