Skip to content

Commit

Permalink
fix(apply): email duplicate check
Browse files Browse the repository at this point in the history
  • Loading branch information
ahnl committed Apr 16, 2024
1 parent ac8bdd6 commit ab0d290
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/routes/apply.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ router.post("/submit", async (req, res) => {

// check if email address already belongs to an assoc member
// if so, swap it to a random one (so that we don't give out info whether someone is a member or not)
const resultEmail = await database.UserInfo.findOne({ "associationMembership.email": email })
const resultEmail = await database.UserInfo.findOne({
"associationMembership.email": email,
"id": { $ne: id }
})
if (resultEmail) {
email = new Date().getTime() + '@testausapis-duplikaatti-email'
}
Expand Down

0 comments on commit ab0d290

Please sign in to comment.