You can find the tutorial for this repo here: https://www.youtube.com/watch?v=Ntg_1jA6KAo
This repo shows how to add authentication to ExpressJS with PassportJS and MongoDB.
The reason why i used PassportJS for this project is because it adds just some few lines of more additional code, but let's you add later on a lot more strategies. However, the part of the code that drives the authentication is pretty much the same as without the use of PassportJS.
For this repo, i used the passport-local strategy. You can add additional strategies. Adding strategies, follows the same principle as shown in this repo. You can find all the avaible strategies here: http://www.passportjs.org/packages/
- ExpressJS
- Mongoose
- MongoDB
- PassportJS
- passport-local
- bcrypt
-
Clone the repo
-
run npm intall
-
run npm start