Is there any way to check email is verified or not before the login. I am sending verification links through Firebase email authentication its work successfully. But I tried to check is Email verified or not.
final FirebaseUser user = firebaseAuth.getCurrentUser();
if (user.isEmailVerified()) {
firebaseAuth.signInWithEmailAndPassword(email, password).addOnCompleteListener(new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful()) {
}
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_SHORT).show();
}
});
} else {
Toast.makeText(getActivity(), "Please verify your email!", Toast.LENGTH_SHORT).show();
}
}
});