In your findOne you are returning the found user in the callback. my guess is that you need to do something like "res.send(user)" , never used mongoose so you might need to convert user to a json object before sending.
in your bcrypt callback function you might be thinking that the second parameter "res" is express js response like it is in the function above but that value is going to just be a plain true or false boolean that tells you if the password and the hash match. so it's likely erroring bc you are trying to call non-existing methods on a boolean.
another error you might be getting from that second function is that you are calling await in front of bcrypt.compare which only returns a promise if you do not insert the callback function. from reading the docs it looks like you just do one or the other. either put in a callback function or await the result.
this is all good stuff you are working on. keep on persisting!
In your findOne you are returning the found user in the callback. my guess is that you need to do something like "res.send(user)" , never used mongoose so you might need to convert user to a json object before sending.
in your bcrypt callback function you might be thinking that the second parameter "res" is express js response like it is in the function above but that value is going to just be a plain true or false boolean that tells you if the password and the hash match. so it's likely erroring bc you are trying to call non-existing methods on a boolean.
another error you might be getting from that second function is that you are calling await in front of bcrypt.compare which only returns a promise if you do not insert the callback function. from reading the docs it looks like you just do one or the other. either put in a callback function or await the result.
this is all good stuff you are working on. keep on persisting!
Thank you for the feedback. I'll makes the changes and try that again.