Help with bcrypt hash compare

Tell us what’s happening:
I can’t figure out whats wrong with this, after I’ve looked at multiple forum topics and the hint page.
when I check my answer via the lesson, the console prints out “request” but nothing seems to happen.

Your code so far
https://repl.it/@SethAlan/boilerplate-bcrypt#server.js

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36.

Challenge: Hash and Compare Passwords Asynchronously

Link to the challenge:

1 Like

The starting project was updated and got messed up you need some comments in your code for the test that are now missing.

Add the comments before and after the code.

//START_ASYNC

//END_ASYNC

It should look like this

//START_ASYNC

bcrypt.hash(myPlaintextPassword, saltRounds, (err, hash)=>{
  console.log(hash);
  //hash prints
  bcrypt.compare(myPlaintextPassword, hash, (err, res)=>{
    console.log(res);
    //prints whether pws match
  })
});

//END_ASYNC
1 Like

Thanks a ton! hopefully you guys can update your original boilerplate for the future :wink:

I made a PR

One more thing, it looks like the next lesson had a similar issue, where it wouldn’t pass, but this time with just SYNC instead of ASYNC in the comments. You guys are the best!

1 Like

You need some for the sync test as well.

//START_SYNC


//END_SYNC
1 Like