lenngri / memegenerator

2 stars 0 forks source link

Encrypt passwords when creating User #20

Open G9A2HvK9 opened 2 years ago

G9A2HvK9 commented 2 years ago

Hash passwords when pushing to DB

G9A2HvK9 commented 2 years ago
image

Hashing function in user model file

G9A2HvK9 commented 2 years ago
image

DB entry with successfully hashed password

G9A2HvK9 commented 2 years ago

Used this article to code the encryption: https://coderrocketfuel.com/article/store-passwords-in-mongodb-with-node-js-mongoose-and-bcrypt#store-a-hashed-password-in-the-database

G9A2HvK9 commented 2 years ago

This article was also useful to get more information on how to approach the problem: https://www.mongodb.com/blog/post/password-authentication-with-mongoose-part-1