title: How do I make firebase verify credential on the login page
body: <p>so im making an app and the user need to create an account so I connect my app to Firebase , everything work fine on the sign up page , but on the login page I can write whatever I want and it goes to the home page ( sign in button target ) but it shouldnt cause it work even when I write invalid credential in the text field I can someone help me I know that I probably made an error but this is the code that im using </p>
  
  <pre><code>import UIKit
  import FirebaseAuth
  import Firebase
  
  class loginViewController: UIViewController {
  
  
  
      @IBOutlet weak var Email: UITextField!
      @IBOutlet weak var Password: UITextField!
  
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          // Do any additional setup after loading the view.
      }
  
  
      @IBAction func SignInButton(_ sender: Any) {
      validateFields()
      }
  
      @IBAction func CreateOneButton(_ sender: Any) {
          let storyboard = UIStoryboard(name: "Main", bundle: nil)
          let vc = storyboard.instantiateViewController(identifier: "SignUpPage")
          vc.modalPresentationStyle = .overFullScreen
          present(vc, animated: true)
      }
      func validateFields() {
          if Email.text?.isEmpty == true {
              print("No email text")
              return
          }
          if Password.text?.isEmpty == true {
              print("No password")
              return
          }
      login()
      }
      func login() {
          Auth.auth().signIn(withEmail: Email.text!, password: Password.text!) { [weak self] authResult, err in
              guard self != nil else {return}
              if let err = err {
                  print(err.localizedDescription)
              }
              self!.checkUserInfo()
          }
      }
      func checkUserInfo() {
          if Auth.auth().currentUser != nil {
              print(Auth.auth().currentUser?.uid as Any)
              let storyboard = UIStoryboard(name: "Main", bundle: nil)
              let vc = storyboard.instantiateViewController(identifier: "Home")
              vc.modalPresentationStyle = .overFullScreen
              present(vc, animated: true)
          }
      }
  }
  </code></pre>