title: How to check user authentication?
body: <p>In the following code I want to buy if the user has entered the username and password correctly. I have this, but it doesn't work.</p>
  <pre><code>else{
              conexion.query('SELECT * FROM user WHERE user = ?', [user], async (error, results)=&gt;{
                  if( results.length == 0 || ! ((results[0].pass)) ){
                      res.render('login', {
                          alert: true,
                          alertTitle: &quot;Error&quot;,
                          alertMessage: &quot;Usuario y/o Password incorrectas&quot;,
                          alertIcon:'error',
                          showConfirmButton: true,
                          timer: false,
                          ruta: 'login'    
                      })
  </code></pre>