Added docker compose, fixed all file paths, updated readme, fixed Async function bcrypt compare

This commit is contained in:
Alex Holliday
2024-06-14 12:07:34 -07:00
parent 51315bb8ed
commit c8bcc59b52
10 changed files with 101 additions and 36 deletions

View File

@@ -46,8 +46,9 @@ UserSchema.pre("save", async function (next) {
next();
});
UserSchema.methods.comparePassword = function (submittedPassword) {
return bcrypt.compare(submittedPassword, this.password);
UserSchema.methods.comparePassword = async function (submittedPassword) {
res = await bcrypt.compare(submittedPassword, this.password);
return res;
};
module.exports = mongoose.model("User", UserSchema);