Skip to content

Commit

Permalink
fix: wrong conditionals in email validation
Browse files Browse the repository at this point in the history
  • Loading branch information
harbassan committed Oct 20, 2024
1 parent 9ca54cc commit 4387903
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions backend/src/routes/api/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,8 @@ router.post(
handle(async (req, res) => {
const email = req?.body?.email || "";
if (
!(email.split("@").length > 1) &&
!allowedDomains.has(email.split("@")[1]) &&
!allowedEmails.has(email)
email.split("@").length <= 1 ||
(!allowedDomains.has(email.split("@")[1]) && !allowedEmails.has(email))
) {
throw new HttpError("Sign in with your UoA account", STATUS.FORBIDDEN);
}
Expand Down

0 comments on commit 4387903

Please sign in to comment.