【发布时间】:2018-04-29 18:55:09
【问题描述】:
我尝试使用 firebase 重新验证用户身份,但似乎无法正常工作。我查看了 firebase 文档,但对我没有帮助。这是我得到的。
var emailTextField: UITextField!
var currentPasswordTextfield: UITextField!
let reEnterInfo = UIAlertController(title: "Re-Enter Email and Password", message: nil, preferredStyle: .alert)
reEnterInfo.addTextField(configurationHandler: emailTextField)
reEnterInfo.addTextField(configurationHandler: currentPasswordTextfield)
let reSignInButton = UIAlertAction(title: "Re-Sign In", style: .default, handler: self.reSignIn)
reEnterInfo.addAction(reSignInButton)
self.present(reEnterInfo, animated: true, completion: nil)
func reSignIn(alert: UIAlertAction!)
{
let user = Auth.auth().currentUser
let credential: AuthCredential
user?.reauthenticate(with: credential) { error in
if error != nil {
} else {
}
}
}
我正在尝试重新验证以更改用户密码。
【问题讨论】:
标签: swift firebase firebase-authentication