bcrypt-nodejsjwt-simplepassportpassport-jwtpassport-local
- bcrypt
- salt
- rainbow tables
- never store plain-text passwords
- JWT
- token-based authentication
- stateless authentication
- JWT secret
Clone down this project. Run npm i.
Start your MongoDB server by running mongod from the command line.
Implement the following routes.
You will also need to create a config.js file that will house your secret.
- [POST]
/signupThis route should add a new user to theuserscollection. After creating the user return aJWTtoken to the client. - [POST]
/signinThis route will receive ausernameandpasswordin the request body. If theusernameandpasswordcombination are valid then return aJWTtoken. - [GET]
/usersThis route will return an array of all users. Only return the users if the user provides a validJWTtoken in theauthenticationheader. - [POST]
/blog-postsThis route should create a new blog post and add it to theblogPostscollection. This route should only work if the user provides a validJWTtoken. - [GET]
/blog-postsThis route should return everyblogPostin an array. This route should only work if the user provides a validJWTtoken.