throw new TypeError('pchstr must be a non-empty string'); What is this error? How to solve it? [duplicate]

1 week ago 8
ARTICLE AD BOX

Code for argon2:

const usercheck = userModel.findOne({ username: req.body.username }) const pwcheck = userModel.findOne({ password: mongoose.Query }) if(!usercheck) return res.status(400).json({success: false, message: "Username not found."}) try { if (await argon2.verify(pwcheck, req.body.password)) { res.status(200).json({ success: true, message:"Logged in!" }) } else { res.status(400).json({ success: false, message: 'invaild password' }) } } catch (err) { console.log(err) }

How do I get the string from the mongoose database? and then so I can give it to argon2 to verify it

Read Entire Article