Issue
When I deleted the user from the Realtime Database by clicking the bin next to it, the user disappears, its okay, but I can still log in by his email and password, and when the login is successful, the UUID of this user reappears when I write some values to subtables in the database, but without his values defined while registering.
I thought that it should be fine after 1 hour and I could have still registered him as a new user, but I can't. I deleted him 2 days ago. What is wrong, how i can delete a user permanently - not by blocking him?
Part of my main code:
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
...
@Override
protected void onCreate(Bundle savedInstanceState) {
//textview,buttons,progress bars, etc...
mAuth = FirebaseAuth.getInstance();
forgotPassword = (TextView) findViewById(R.id.forgotPassword);
forgotPassword.setOnClickListener(this);
}
...
//Onclicks, textview value correctness etc...
progressBar.setVisibility(View.VISIBLE);
FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
mAuth.signInWithEmailAndPassword(email,password).addOnCompleteListener(new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if(task.isSuccessful()){
FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
if(user.isEmailVerified()){
// redirect to user profile
progressBar.setVisibility(View.GONE);
startActivity(new Intent(MainActivity.this, ProfileDashboard.class));
}else {
progressBar.setVisibility(View.GONE);
user.sendEmailVerification();
Toast.makeText(MainActivity.this,"Check your email to verify your account!", Toast.LENGTH_LONG).show();
}
}else{
progressBar.setVisibility(View.GONE);
Toast.makeText(MainActivity.this, "Failed to login! Please check your credentials", Toast.LENGTH_LONG).show();
}
}
});
}
}
Solution
The Realtime Database
is not the same as Authentication
.
Deleting the user in Authentication will do the trick:
Answered By - Dabbel
Answer Checked By - Senaida (JavaFixing Volunteer)