reset password

This commit is contained in:
Adolfo Reyna
2021-10-14 21:29:33 -07:00
parent 47f35aba3e
commit 7da0f3093d
2 changed files with 44 additions and 0 deletions

View File

@@ -35,6 +35,11 @@ const getDB = new Promise((resolve, reject) => {
return DB.usersCol.findOne({ username: username });
}
DB.resetUserPassword = (username, password)=>{
return DB.usersCol.updateOne({username}, {$set:{password}})
.catch(console.error);
}
DB.getUserById = (userid)=>{
const _id = new mongo.ObjectID(userid);
return DB.usersCol.findOne({ _id });