I sign up with email and phone number(+ otp vérification) and password . i link Multiple Auth like picture bellow .
I want to sign in with phone number or email (same edit text) and password without otp vérification
mLogin.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(final View v) {
if( !validateEmail()|!validatePassword()){
return;
}
mProgress.show();
final String EmailOrPhone=mEmailOrPhone.getEditText().getText().toString();
final String password=mPass.getEditText().getText().toString();
//if sign in with email
if (EmailOrPhone.matches("[a-zA-Z0-9._-]+@[a-z]+\.+[a-z]+")){
mAuth.signInWithEmailAndPassword(email,password).addOnCompleteListener(ClientLoginAct.this,
new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (!task.isSuccessful()){
mProgress.dismiss();
Snackbar.make(v, "Email or Password incorrect", Snackbar.LENGTH_LONG).show();
//Toast.makeText(ClientLoginAct.this,"Email or Password incorrect ",Toast.LENGTH_SHORT).show();
}
}
});
}
//if sign in with phone
if(EmailOrPhone.matches("[0-9]")){
///////////////// What I put here to sign in, I want to sign in with phone number and password without otp vérification ////////////
}
}
});