How to do confirmation signin to confirm the password is true with fireauth

Viewed 46

Firstly i want to check the password and email is true with fireauth. If the password is false not same with fireauth, that will popup toast.

 firebaseAuth.signInWithEmailAndPassword(email,password)
            .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
                @Override
                public void onComplete(@NonNull Task<AuthResult> task) {
                    progressDialog.dismiss();
                    if(task.isSuccessful()){
                        finish();
                        if(!password.equals()){

                        }
                        userVerified();
                    }else{
                        Toast.makeText(Signin.this, "Your account not registered",Toast.LENGTH_LONG).show();
                        startActivity(new Intent(getApplicationContext(),Signup.class));
                    }
                }
            });
}

i stuck on password.equals. i don't know how to match with fireauth.

1 Answers

task.getException() gives you the exact error of the sign in failure, so in the else part in your Toast message you can print the exception message. Do let me know if this helps.

Related