Firebase kicks out current user

前端 未结 14 2033
一个人的身影
一个人的身影 2020-11-22 01:42

So I have this issue where every time I add a new user account, it kicks out the current user that is already signed in. I read the firebase api and it said that \"I

14条回答
  •  庸人自扰
    2020-11-22 02:05

    Swift 5: Simple Solution

    First store the current user in a variable called originalUser

    let originalUser = Auth.auth().currentUser
    

    Then, in the completion handler of creating a new user, use the updateCurrentUser method to restore the original user

    Auth.auth().updateCurrentUser(originalUser, completion: nil)
    

提交回复
热议问题