diff --git a/API/Application/Users/Commands/CreateUser.cs b/API/Application/Users/Commands/CreateUser.cs index 9954904..419ee62 100644 --- a/API/Application/Users/Commands/CreateUser.cs +++ b/API/Application/Users/Commands/CreateUser.cs @@ -16,6 +16,11 @@ namespace API.Application.Users.Commands public async Task> Handle(SignUpDTO signUpDTO) { + if (!new Regex(@".+@.+\..+").IsMatch(signUpDTO.Email)) + { + return new ConflictObjectResult(new{message = "Invalid email address."}); + } + List existingUsers = await _repository.QueryAllUsersAsync(); foreach (User existingUser in existingUsers)