Anshul439 / Blogverse

A MERN stack Blog App
https://blogverse-l4af.onrender.com
17 stars 23 forks source link

Data sanitization and abstraction #22

Closed shahbaz36 closed 1 month ago

shahbaz36 commented 1 month ago

I worked on the following features:

  1. Added a catchAsync to abstract out repetitve try-catch block
  2. Moved password hashing to pre save middleware on userSchema
  3. Moved jwt's creation to a new method (signToken)
  4. Added a correct implementation for signin handler now email and password will be correctly checked before loggin in the user.
  5. Added mongoSanitize to prevent NoSql query injection.

After all these changes i have also tested signup and singin api's with my own mongo database.