Firebase Ios Swift身份验证问题
我的代码不能正常工作。我创建了google firebase身份验证。我的密码坏了Firebase Ios Swift身份验证问题,ios,swift,authentication,firebase-authentication,Ios,Swift,Authentication,Firebase Authentication,我的代码不能正常工作。我创建了google firebase身份验证。我的密码坏了 @IBAction func loginClicked(_ sender: UlButton) { if let email = usernameText.text, let password = passwordText.text { Auth.auth().signIn(withEmail: email, password: password) {authResult,
@IBAction func loginClicked(_ sender: UlButton) {
if let email = usernameText.text, let password = passwordText.text {
Auth.auth().signIn(withEmail: email, password: password) {authResult, error in
self.makeAlert(titleInput: "Error", messagelnput:"Error")
}
self.performSegue(withldentifier: "goToViewController", sender: nil)
}
}
然后我写了这个代码。当您在登录页面上输入错误的电子邮件和密码时,将显示错误消息。但它也会转到另一个页面(主页,ldentifier:“goToViewController”)。我不想这样做。当我输入错误的电子邮件和密码时,我只想显示错误消息
我该怎么做?
感谢您的帮助您需要在firebase的关闭响应中添加
performsgue
@IBAction func loginClicked(_ sender: UlButton) {
if let email = usernameText.text, let password = passwordText.text {
Auth.auth().signIn(withEmail: email, password: password) {authResult, error in
if error == nil {
self.performSegue(withldentifier: "goToViewController", sender: nil)
}
else {
self.makeAlert(titleInput: "Error", messagelnput:"Error")
}
}
}
}