Logging in, checking the login and blocking data overwriting in the firebase

Why aren't you using Firebase Authentication, then all these problems just "go away" ?