Closed JohanG2012 closed 5 years ago
User passwords should be encrypted with bcrypt: https://www.npmjs.com/package/bcrypt
Add a pre-save hook to the User models which encrypt the password.
Add a comparePassword method to the model which allows for a password to be compared with the stored hash.
More info see the first answer here: https://stackoverflow.com/questions/14588032/mongoose-password-hashing
User passwords should be encrypted with bcrypt: https://www.npmjs.com/package/bcrypt
Add a pre-save hook to the User models which encrypt the password.
Add a comparePassword method to the model which allows for a password to be compared with the stored hash.
More info see the first answer here: https://stackoverflow.com/questions/14588032/mongoose-password-hashing