title: Firebase Email Verification Swift
body: <p>I tried to use the Firebase Authentication, but in the login lets me in even when I haven't used the email to confirm the verification.
  I have two Viewcontroller , one for Login and the other for signUP.
  I can log in and I get the email for verification, but I can also log in in without verification.</p>
  
  <pre><code>public func sendVerificationMail() {
    if self.authUser != nil &amp;&amp; !self.authUser!.isEmailVerified {
      self.authUser!.sendEmailVerification(completion: { (error) in
        // Notify the user that the mail has sent or couldn't because of an error.
      })
    } else {
      // Either the user is not available, or the user is already verified.
    }
  }
  
  @IBAction func signupButtonTapped(_ sender: Any) {
    print("Sign up button tapped")
    Auth.auth().createUser(withEmail: self.userEmailTextField.text!, password: self.userPasswordTextField.text!) { (user, error) in
      if user != nil {
        print("User has Signed Up")
        self.sendVerificationMail()    
      }
      if error != nil {
        print("User cant Sign Up")
      }
    }
  }
  
  @IBAction func signinButtonTapped(_ sender: Any) {
    Auth.auth().signIn(withEmail: self.userEmailTextField.text!, password: self.userPasswordTextField.text!) { (user, error) in
      if user != nil {
        print("User has Signed In") 
      }
      if error != nil {
        print("Cant Sign in user")
      } else {
        self.performSegue(withIdentifier: "toHome", sender: nil)
      }
    }
  }
  </code></pre>