bcrypt-nodejs
jwt-simple
passport
passport-jwt
passport-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]
/signup
This route should add a new user to theusers
collection. After creating the user return aJWT
token to the client. - [POST]
/signin
This route will receive ausername
andpassword
in the request body. If theusername
andpassword
combination are valid then return aJWT
token. - [GET]
/users
This route will return an array of all users. Only return the users if the user provides a validJWT
token in theauthentication
header. - [POST]
/blog-posts
This route should create a new blog post and add it to theblogPosts
collection. This route should only work if the user provides a validJWT
token. - [GET]
/blog-posts
This route should return everyblogPost
in an array. This route should only work if the user provides a validJWT
token.