title: data and hash arguments required
body: <p>I have this user registration route that goes like this:</p>
  <pre><code>app.post(&quot;/register&quot;, async(req, res)=&gt;{
      const id = req.body.id
      const name = req.body.name
      const lastName = req.body.lastName
      const email = req.body.email
      const password = req.body.password
      const company = req.body.company
      const type = req.body.type
      const hashedPassword = bcrypt.hashSync(password, 10);
      const user = new User ({id: id, name: name, lastname: lastName, email: email, pass: 
      hashedPassword, company: company, type: type});
  try {
      
      await user.save();
      console.log('user '+name+ ' inserted!');
  } catch (err) {
      console.log(err);
  }
  })
  </code></pre>
  <p>And as you can see im using the hashing method of bcrypt and then when i use the bcrypt.compare in the login route it doesn't work:</p>
  <pre><code>app.post('/login', async(req, res)=&gt;{
  const id = req.body.id
  const password = req.body.password
  try {
      const user = await User.findOne({id: id})
      if(!user) res.send({message: &quot;invalid id or password!&quot;, token: &quot;empty&quot;})
      const validPassword = await bcrypt.compare(password, user.password);
      console.log(user.password+' this '+ password)
      if (!validPassword) return res.send({message:&quot;invalid password&quot;, token: &quot;empty&quot;})
      if(user &amp;&amp; validPassword){
          const token = jwt.sign({
              jwtid: id,
              jwtpassword: password,
          }, &quot;01021997&quot;)
          res.cookie(&quot;jwt&quot;, token, {maxAge: 1000})
          res.send({message: &quot;logged in succesfully&quot;, token: token})}
          
      
  } catch (err) {
      console.error(err.message)
  }
  })
  </code></pre>
  <p>So i get the error &quot;data and hash arguments required&quot; altho i already hashed the password while registration</p>