Re-authenticating User Credentials Swift

后端 未结 3 1840
清酒与你
清酒与你 2020-12-13 11:05

I wish to re-authenticate a user prior to allowing them to change their login information. However, due to the recent Firebase update, I found the documentation rather unhel

3条回答
  •  醉酒成梦
    2020-12-13 11:46

    Firebase's documentation is currently outdated. Here is the correct way to handle reauthenticate.

    let user = Auth.auth().currentUser
    
    user?.reauthenticate(with: credential, completion: { (result, error) in
       if let err = error {
          //..read error message             
       } else {
          //.. go on              
       }
    })
    

提交回复
热议问题