Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: send to login on forgot pwd sent #258

Merged
merged 1 commit into from
Oct 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions lib/presentation/login/bloc/login_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,19 @@ class LoginBloc extends Bloc<LoginEvent, LoginState> {
on<ForgotPasswordPressed>(_onForgotPasswordPressed);
on<NewUserSignUp>(_onNewUserSignUp);
on<CreatedPasswordNewUser>(_onCreatePasswordNewUser);
// on<ForgotPasswordPressed>((event, emit) {
// emit(ForgotPasswordState(emailID: event.emailId));
// });
on<SendPasswordResetInstructions>(_onSendPasswordResetInstructions);
on<ToggleObscureCreatePassword>(_onToggleObscureCreatePassword);
on<SetPassword>(_onSetPassword);
}

FutureOr<void> _onSendPasswordResetInstructions(event, emit) async {
//TODO: complete logic
emit(Loading());
try {
await userRepository.sendResetPasswordLink(event.emailId);
//TODO: show dialog box that instructions have been sent
//TODO: route (if needed)
emit(const LoginInitial(error: "Reset Link sent to email!"));
} catch (e) {
// TODO: show dialog box with error
emit(const LoginInitial(error: AppConstants.GENERIC_FAILURE));
}
// for reference, see forgot_password_viewmodel.dart on master branch
}

FutureOr<void> _onCreatePasswordNewUser(event, emit) async {
Expand Down