Firebase sign out not working in Swift

后端 未结 3 807
傲寒
傲寒 2021-01-01 18:12

I am using newest Firebase API (3.2.1) and I am using this code to check if user is signed in:

override func viewDidAppear(animated: Bool) {
    super.viewDi         


        
3条回答
  •  猫巷女王i
    2021-01-01 19:09

    2020 ...

    do { try Auth.auth().signOut() }
    catch { print("already logged out") }
    

    Typically, on your "base" screen, something like ...

    func logoutUser() {
        // call from any screen
        
        do { try Auth.auth().signOut() }
        catch { print("already logged out") }
        
        navigationController?.popToRootViewController(animated: true)
    }
    

提交回复
热议问题