我想使用 firebase 设置电子邮件/密码身份验证,并编写类似于文档的内容。我只有一个正在测试的注册电子邮件,当我尝试使用该电子邮件登录时,一切正常。但是当我输入另一个电子邮件/密码时,完成 block 不会执行。
Auth.auth().signIn(withEmail: email, password: password) { [weak self] (user, error) in
guard let strongSelf = self else {
return
}
if let error = error {
let errorAlert = UIAlertController(title: "Error", message: error.localizedDescription, preferredStyle: .alert)
errorAlert.addAction(UIAlertAction(title: "OK", style: .default, handler: nil))
strongSelf.present(errorAlert, animated: true, completion: nil)
return
}
}
最佳答案
没关系,我修好了它。我在完成的外部有一条 PerformSegue 线,而它本应位于内部,在 Guard 和 if let 语句之后。
关于swift - 如何让 Firebase Auth 显示错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57167383/