Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernising the auth app #174

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open

Conversation

domluther
Copy link

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

  1. Removed the .env file from the repo and added it to gitignore because I didn't want to share mine.
  2. Removed nodemon from package.json
  3. Changed the repo to start with node --watch instead of nodemon.
  4. Updated bcrypt, tested creating and signing in. OK.
  5. Updated ejs
  6. Removed dotenv from package.json and server.js
  7. Changed the script to start as "start": "node --watch --env-file=./config/.env server.js",
  8. Updated express
  9. Updated express-session
  10. Updated passport
  11. Updated validator
  12. Removed mongodb - not actually used
  13. Updated to mongoose 6 (incremental update to make it easier to debug)
    1. Updated database.js. useFindAndModify & useCreateIndex were removed as options.
  14. Updated to connect-mongo 4
    1. Don't call (session) on import
    2. Changed option from mongoConnection to mongoUrl as needed in mongo 4
    3. Fixed logout method in controllers/auth.js -
  15. Updated to connect-mongo 5 - no changes needed
  16. Updated to mongoose 7 - promises/async needed instead of callbacks for eg findById()
    1. Updated deserializeUser in passport.js to use async/await
    2. Updated localStrategy findOne in passport.js to use async/await
    3. Updated controllers/auth.js postSignup findOne and save to use async/await
  17. Updated to mongoose 8
    1. Removed newUrlParser and unifiedTopology options (deprecated) from database.js
  18. Added .nvmrc - set to 20.6 due to use of --env-file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants