Information Security with HelmetJS - Understand BCrypt Hashes

Hello i am in need of your help passing: Understand BCrypt Hashes.

I am using VScode to do this project and i have copied the boiler plate and ran ‘npm install, npm install bcrypt’ ect.

bcrypt is a dependency and i have in the server.js file:
const bcrypt = requiere(‘bcrypt’);
at the top of the code.

but when i submit the localhost url, both test fail.

should i use glitch as i see on YouTube or is it a version problem?
the boilerplate version is v5.0.1

###Your project link(s)

solution: https://bcrypt-test.netlify.app

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36

Challenge Information:

Information Security with HelmetJS - Understand BCrypt Hashes

I just had the same problem and solved it by adding the following to my server.js

const cors = require('cors')
app.use(cors())

Opening the dev-console (F12) on the fcc testing site revealed there was a cors issue which made it impossible for the testrunner to access the package.json on my machine.

I don’t know why this is necessary here since other projects (like the helmet.js project before this one) seems to relax the cors settings via fcctesting.js just fine.

Side note: configuring cors like this has negative security implications but if you are only running the API locally, it will hopefully be okay.

2 Likes

Thank you!! I was looking for weeks for this solution. :partying_face:

2 Likes