title: How to do a login verification
body: <p>I am creating a system in nodejs + mongodb but I am having difficulty checking if the email and password match.</p>
  
  <p>this is the function that sends the parameters to the api:</p>
  
  <pre><code>function log(e){
  e.preventDefault();
  let email = document.querySelector('input[name="email"]').value;
  let password = document.querySelector('input[name="password"]').value;
  let loginstatus = document.querySelector('#loginstatus');
  
  fetch('http://localhost:3000/userV', { method: 'post', headers: {Accept: 'application/json', 'Content-Type': 'application/json'}, body: JSON.stringify({
    email: email,
    senha: password
  })
  }).then((resp) =&gt; {
  if(resp.status == 200){
  
  
  }else{
    loginstatus.textContent = 'Usuario ou senha incorretos!';
    loginstatus.style.color = 'red';
  }
  }).catch((err) =&gt; {
  alert("Ouve um erro no servidor.\nErro:"+err);
  });}
  </code></pre>
  
  <p>here is where it should be doing the verification but always returns "yes", what is wrong in my form? would you have another recommended way to do it?</p>
  
  <pre><code>async index(req, res) {
      let reqemail = req.params.email;
      let reqsenha = req.params.senha;
  
      const users = await Users.find({ email: reqemail });
  
      if(reqsenha == users.senha){
          return res.send('yes')
      }else{
          return res.send('no')
      }
  }
  </code></pre>