feat(01-06): create password update page with validation

- Implemented UpdatePasswordPage with password strength indicator
- Added password validation utility with comprehensive checks
- Enhanced AuthProvider with updatePasswordFromReset method
- Extended AuthRepository interface and implementation for password reset
- Added InvalidTokenException to auth exception hierarchy
- Includes accessibility features and error handling
- Password strength indicator with real-time feedback

Files:
- lib/features/authentication/presentation/pages/update_password_page.dart
- lib/core/utils/password_validator.dart
- lib/providers/auth_provider.dart
- lib/features/authentication/domain/repositories/auth_repository.dart
- lib/features/authentication/data/repositories/auth_repository_impl.dart
- lib/core/errors/auth_exceptions.dart
This commit is contained in:
Dani B
2026-01-28 12:05:15 -05:00
parent a9f1bf75e8
commit e56dd26fef
6 changed files with 616 additions and 1 deletions

View File

@@ -393,6 +393,28 @@ class AuthProvider extends StateNotifier<AuthState> {
}
}
/// Updates password from reset token (password reset flow)
///
/// [newPassword] - The new password to set
///
/// Throws AuthException if update fails
Future<void> updatePasswordFromReset(String newPassword) async {
if (state.isLoading) return;
state = state.copyWith(isLoading: true, clearError: true);
try {
await _authRepository.updatePasswordFromReset(newPassword);
state = state.copyWith(isLoading: false);
} catch (e) {
state = state.copyWith(
isLoading: false,
error: e.toString(),
);
rethrow;
}
}
/// Clears any authentication error
void clearError() {
state = state.copyWith(clearError: true);