Skip to content

Commit

Permalink
Fix duplicate account prevention.
Browse files Browse the repository at this point in the history
  • Loading branch information
shrihari-prakash committed Jan 8, 2025
1 parent 8d2dabe commit 9b7d05b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/service/api/user/create.post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ const POST_Create = async (req: Request, res: Response) => {
.json(new ErrorResponse(errorMessages.clientInputError, { errors }));
}
const existingUser = (await UserModel.findOne({
$or: [{ sanitizedEmail: sanitizeEmailAddress(email) }, { username }],
$or: [{ sanitizedEmail: sanitizeEmailAddress(email) }, { email }, { username }],
}).exec()) as unknown as UserInterface;
if (existingUser) {
const duplicateFields = [];
Expand Down

0 comments on commit 9b7d05b

Please sign in to comment.