Q:

Firebase check auth status of user/ if user exists

So I built a simple app using Firebase Authentication (with just email and password) and it was working great, but in order to TestFlight my sign up/login page I needed to delete the accounts of everyone who had signed up with the app previously, only to find that deleting the users on the console doesn't actually deauth them in the app. I would imagine there would be a way to check a user's authentication status in the Firebase console (if they exist or not at least) but I can't find that functionality to save my life. Any help is welcome and appreciated!

A:

I ran into this same issue and found a workaround that I've been using ever since. Instead, I just query my database in /users (a category I created for users) and check if my current ID exists. If it does not, I know the account has been deleted. This means you need to create an entry with your userID in /users on sign up and delete this entry when you delete the account. To see if currently authenticated user is deleted then, do something like this:
NSString *currentID=[[FIRAuth auth].currentUser uid];
[[[[[FIRDatabase database]reference]child:@"users"]child:currentID]observeSingleEventOfType:FIRDataEventTypeValue withBlock:^(FIRDataSnapshot * _Nonnull snapshot) {
    if (snapshot!=[NSNull Null]) {
        //User still exists
    } else {
        //Account no longer exists (deleted)
    }
}];

