Розкажіть нам, що сталося:
Детально опишіть свою проблему тут.
Посилання на ваші проєкти
solution: boilerplate-bcrypt - Replit
Інформація про ваш браузер:
Агент користувача: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36 Edg/115.0.1901.203
Завдання: Інформаційна безпека з HelmetJS - Асинхронне хешування та порівняння паролів
Посилання на завдання:
Асинхронне хешування повинне бути правильно згенероване та порівняне.
Я не розумію у чому проблема, наче усе правильно?
You made a lot of changes that were not asked for and you have added the code from the previous boilerplate into the new one. Do not do that.
I think it is easier if you start over.
- Copy/paste the original code back into your server.js.
https://raw.githubusercontent.com/freeCodeCamp/boilerplate-bcrypt/main/server.js
-
Require in bcrypt
-
Between the “START_ASYNC” code comments add the two method calls shown in the challenge text, but combine them. You must keep the arguments as is.
I added a code comment, that is all you need to do. Add that console log.
//START_ASYNC -do not remove notes, place code between correct pair of notes.
bcrypt.hash(myPlaintextPassword, saltRounds, (err, hash) => {
bcrypt.compare(myPlaintextPassword, hash, (err, res) => {
// add a consol log that logs "res" here
});
});
//END_ASYNC
ok thank u, but add my code were the step before, about adding hashing i thought it should be write down, ok lets test it
ok its done, but my previous code, why it was asked to add? and if you can please explain me shortly about why it works without my code.
думайте інакше:
як написати тест який перевіряє чи ви правильно все написали ???
тому будь-яки додаткові речи ускладнюють код тесту
і тому тест може впасти коли ви додаєте те, що вас не просили додавати
Тому не додавайте нічого зайвого
english:
think about it differently
how to write a test whiсh check that you wrote everything correctly ???
Thus any additional things complicate the test code
and that’s why the test can break when you add things which you weren’t asked to add
That’s why you shouldn’t add anything extra.