arch-atlas

Password Recovery Screens

forget_password + change_password presentation

presentation

Overview

Four screens: ForgetPasswordScreen (request email), ResetPasswordOtpScreen (verify code), ResetPasswordScreen (set new), ChangePasswordScreen (authenticated rotate). Each consumes its dedicated Riverpod notifier and surfaces a single error toast on failure.

User Flow

  1. ForgetPasswordScreen → forgotPasswordProvider.sendResetEmail.
  2. Navigation pushes ResetPasswordOtpScreen with email; on verify it pushes ResetPasswordScreen with {email, token}.
  3. ResetPasswordScreen submits new password and pops back to login.
  4. ChangePasswordScreen (settings entry) calls changePasswordProvider directly without OTP.

Cases & Edge Cases

  • Reset-flow routes pass data via state.extra and crash on direct deep-link entry (no deep-link guard).
  • ChangePasswordScreen does not require the user's current password to match — backend handles that validation; the screen surfaces server errors as generic messages.
  • Both flows treat any non-2xx as 'Something went wrong. Try again!' to avoid enumeration / leaking server state.

Code References

  • lib/src/features/shared/auth/forget_password/presentation/forget_password.dart
  • lib/src/features/shared/auth/forget_password/presentation/reset_password_otp_screen.dart
  • lib/src/features/shared/auth/forget_password/presentation/reset_password_screen.dart
  • lib/src/features/shared/auth/change_password/presentation/change_password.dart

API Calls

Empty — fill this in later. Open the manifest and add content here.

Notes

Generic error messages are a deliberate design choice — see the matching comment in change_password_notifier.dart.