When I delete an account on my Firebase console, the user stills logged in to my app, I use this code to keep the user logged. How can I log out the user when I delete his account?
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(true)
//check if user is logged in
if FIRAuth.auth()?.currentUser != nil {
//if user if logged in
let vc = self.storyboard?.instantiateViewController(withIdentifier: "mainVC")
self.present(vc!, animated: false, completion: nil)
}
}
But I don't know how to check if the account that is using the user is valid or not (if the account continues at the firebase console or not) before the "automatic log in". Hope someone can help me out!!! Thanks in advance!