So im getting this error
Error: Illegal arguments: string, undefined
and this is the code
router.post('/loguser', async (req, res) => {
const compareHashed = await bcrypt.compare(req.body.password)
const user = await User.findOne({
username: req.body.username,
password: compareHashed
})
if (user) {
console.log('user is found')
}
if (!user) {
console.log('user is not found')
}
})
does anyone know how to fix this, I know its a problem with bcrypt