title: RequestError: Invalid column name node js sql server passport
body: <p>Good day, I'm doing a login system using the SQL server (MSSQL), the js node and the passport, the user registry works fine, but the login fails authentication, always returns a user not found, I am a newbie in this and I would like to be guided a little I enclose my code where I do the authentication my code is: file passport.js</p>
  
  <pre><code>     passport.use('local.signin', new LocalStrategy({
       usernameField: 'username',
       passwordField: 'passwords',
       passReqToCallback: true
       }, async (req, username, passwords, done) =&gt; {
       const request=pool.request();
       //request.input('username',username);
      //request.input('passwords',passwords);
      const rows = await request.query(`SELECT * FROM signUp WHERE username=${username}`);
       console.log(passwords)
      if (rows.length &gt; 0) {
      const user = rows[0];
      const validPassword = await   helpers.matchPassword(passwords,user.passwords)
      if (validPassword) {
        done(null, user, req.flash('success', 'Bienvenido' + user.username));
      } else {
        done(null, false, req.flash('message', 'Incorrect Password'));
      }
    } else {
      return done(null, false, req.flash('message', 'El Nombre de usuario no existe'));
  }    
  }));
  
     passport.use('local.signup', new LocalStrategy({
      usernameField: 'username',
      passwordField: 'passwords',
      passReqToCallback: true
      }, async (req, username, passwords, done) =&gt; {
  
      var user = {
      username : req.body.username,
      passwords :req.body.passwords
     };
     user.passwords = await helpers.encryptPassword(passwords);
     // Saving in the Database
     request.input('username',user.username);
    request.input('passwords',user.passwords);
    const result = await request.query("insert signUp values(@username,@passwords)");
     user.id = result.insertId;
     return done(null, user);
     }));
  
     passport.serializeUser(function(user, done) {
     done(null, user.id);
     });
  
    passport.deserializeUser(async (id, done)=&gt; {
    const rows = await pool.query(`SELECT * FROM signUp WHERE id =${id}`);
    done(null, rows[0]);
    });
  </code></pre>
  
  <p>routes.js </p>
  
  <pre><code>// SIGNUP
  router.get('/signup', (req, res) =&gt; {
    res.render('auth/signup');
  });
  
  router.post('/signup', passport.authenticate('local.signup', {
    successRedirect: '/profile',
    failureRedirect: '/signup',
    failureFlash: true
  }));
  
  // SINGIN
  router.get('/signin', (req, res) =&gt; {
    res.render('auth/signin');
  });
  
  router.post('/signin', (req, res, next) =&gt; {
    req.check('username', 'Username is Required').notEmpty();
    req.check('passwords', 'Password is Required').notEmpty();
    const errors = req.validationErrors();
    if (errors.length &gt; 0) {
      req.flash('message', errors[0].msg);
      res.redirect('/signin');
    }
    passport.authenticate('local.signin', {
      successRedirect: '/profile',
      failureRedirect: '/signin',
      failureFlash: true
    })(req, res, next);
  });
  
  router.get('/logout', (req, res) =&gt; {
    req.logOut();
    res.redirect('/');
  });
  
  router.get('/profile', isLoggedIn, (req, res) =&gt; {
    res.render('profile');
  });
  
  module.exports = router;
  </code></pre>