title: why does the second `if` statement in post method not run?
body: <p>I'm working on a node.js login page example. But whatever password i put in, it always returns status <code>ok</code>. And the second <code>if</code> statement about checking if password is equal to the hash value doesn't seem to run. why is that?</p>
  <pre><code>  app.post('/api/login',async (req,res)=&gt;{
          console.log(&quot;you received a message&quot;);
          const username = req.body.username;
          const password = req.body.password;
          console.log({username,password})
          const userexist = await logininfo.findOne({username});
          console.log(userexist);
          const passtrue = await bcrypt.compare(password,userexist.password);
          console.log(passtrue);
          if (!userexist) {
               return res.json({status:'error',error:&quot;invalid user/password&quot;})
           }
      
          if (passtrue){
              console.log(passtrue);
              return res.json({status:'ok',statustext:'you are good to go'})
          }
          res.json({status: 'ok'});
      })
  </code></pre>
  <p>here is the log</p>
  <pre><code>connect db success
  app listening on port 3000
  you received a message
  { username: 'xt851231', password: '123123123' }
  {
    _id: new ObjectId(&quot;62e14b57ad7fc1e3775df133&quot;),
    username: 'xt851231',
    password: '$2a$10$ZZTHC6uY5EPWryGOWGr6m.2rvj5vHUerJxJoCGDv.M4DnISCHehya',
    __v: 0
  }
  </code></pre>