Skip to content

IA-926 :feat(profile): Remove duplicate reset password flow and fix language/timezone preferences persistence

khadija.elbachouri a demandé de fusionner feature/IA-926 vers develop

Summary

Two separate cleanup changes across the profile section: removes a redundant password reset button from the security page, and fixes language/timezone preferences so they persist across page refreshes.

Changes

security/pages.tsx

  • Removed the "send reseted password" button and its associated handleSendResetCode flow from the password form — this logic is already fully handled by the "Mot de passe actuelle oublié" link which routes to the dedicated reset password page.
  • The OTP input card (showOtpInput) and its handlers (handleSendResetCode, handleConfirmResetCode, OTP state, refs) are kept since they are still used by the forgot password flow triggered from the link.

languages/page.tsx

  • Fixed useEffect to load saved preferences from localStorage on mount (language, auto-detect toggle, manual timezone selection) so values survive page refresh.
  • Fixed auto-detect toggle: re-enabling it now snaps selectedTimezone back to the browser-detected timezone.
  • Fixed timezone info text to dynamically reflect the current state ("Détecté automatiquement" vs "Fuseau horaire sélectionné").
  • Replaced alert() with a Snackbar/Alert for save confirmation.
  • Added Snackbar and Alert to MUI imports.
  • Added showAlert state.
  • Added Casablanca to the timezones list.

Rapports de requête de fusion