How to check if the email address exists or not and only if exists than send the email. In this moment an email is sent even if the entered email address is not assigned to a registered account (task.isSuccessful() return always true).
fAuth = FirebaseAuth.getInstance();
fAuth.sendPasswordResetEmail(email.getEditText().getText().toString()).addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
if (task.isSuccessful()) {
NewFragment newFragment = new NewFragment();
loadFragment(newFragment);
} else {
email.setError(getString(R.string.email_not_assigned));
}
}
});
Recognized by Google Cloud Collective