todo-mvc-auth-local
todo-mvc-auth-local copied to clipboard
Modernising the auth app
In class 52 you mentioned that if someone went through and put a pull request for updating the app you'd accept it. You were only talking about a couple of lines, but I went a bit beyond that. :)
I've gone through and updated all the packages and tested everything related to them. Here's the list of changes :)
Changes
- Removed the .env file from the repo and added it to gitignore because I didn't want to share mine.
- Removed nodemon from package.json
- Changed the repo to start with node --watch instead of nodemon.
- Updated bcrypt, tested creating and signing in. OK.
- Updated ejs
- Removed dotenv from package.json and server.js
- Changed the script to start as "start": "node --watch --env-file=./config/.env server.js",
- Updated express
- Updated express-session
- Updated passport
- Updated validator
- Removed mongodb - not actually used
- Updated to mongoose 6 (incremental update to make it easier to debug)
- Updated database.js. useFindAndModify & useCreateIndex were removed as options.
- Updated to connect-mongo 4
- Don't call (session) on import
- Changed option from mongoConnection to mongoUrl as needed in mongo 4
- Fixed logout method in controllers/auth.js -
- Updated to connect-mongo 5 - no changes needed
- Updated to mongoose 7 - promises/async needed instead of callbacks for eg findById()
- Updated deserializeUser in passport.js to use async/await
- Updated localStrategy findOne in passport.js to use async/await
- Updated controllers/auth.js postSignup findOne and save to use async/await
- Updated to mongoose 8
- Removed newUrlParser and unifiedTopology options (deprecated) from database.js
- Added .nvmrc - set to 20.6 due to use of --env-file