I am trying to log a user out with Firebase 3 in my iOS application. Here is my code:
do {
databaseReference.child("Users").child(CUUID!).removeAllObservers()
try FIRAuth.auth()?.signOut()
print("FIRUSER - \(FIRAuth.auth()?.currentUser)")
self.performSegueWithIdentifier("logOutSegue", sender: self)
} catch let logOutError {
print("Error Logging User Out - \(logOutError)")
}
What I am trying to do is perform a segue back to the login screen if a user is successfully logged out. In order to check if a user was logged out, I print currentUser
to see if there is still one. I hit the logOut
button and the segue works (no catch -> no error), but when the print("FIRUSER - \(FIRAuth.auth()?.currentUser)")
code runs, I still get a currentUser. Why is the user not being logged out?