Skip to content

Commit

Permalink
Merge branch 'main' into user-page
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyDeSantiago committed Sep 25, 2023
2 parents b28e56f + e600545 commit 44c2185
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions public/forgotpassword.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,24 +63,28 @@ async function validateNewPassword(password, user){
return true;
}

async function fetchUser(username){
async function fetchUser(username/*, userEmail*/){
try{
const userData = [];
var userData = [];
username = username.toString();
//userEmail = userEmail.toString();
const q = query(users, where('username', '==', username));
const getUsers = await getDocs(q).then((querySnapshot) => {
const tempDoc = [];
tempDoc.push({ id: doc.id, ...doc.data() });
querySnapshot.forEach((doc) => {
tempDoc.push({ id: doc.id, ...doc.data() });
});
userData = tempDoc;
})
if(userData.userEmail == userEmail){
return userData;
} else {
console.log("userData error, userData = " + userData);
return false;
}
//if(userData.userEmail == userEmail){
return userData;
//} else {
// console.log("userData error, userData = " + userData);
// return false;
//}
} catch(error) {
console.log(error)
console.log(error);
alert("Please enter the correct username and e-mail associated with the account before proceeding.");
}
return false;
}
Expand Down

0 comments on commit 44c2185

Please sign in to comment.