Skip to content

Commit cce9132

Browse files
committed
Prevent multiple emails separated by commas in email field
1 parent e0fa893 commit cce9132

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

priv/templates/phx.gen.auth/schema.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ defmodule <%= inspect schema.module %> do
4646
defp validate_email(changeset, opts) do
4747
changeset
4848
|> validate_required([:email])
49-
|> validate_format(:email, ~r/^[^\s]+@[^\s]+$/, message: "must have the @ sign and no spaces")
49+
|> validate_format(:email, ~r/^[^@,;\s]+@[^@,;\s]+$/, message: "must have the @ sign and no spaces")
5050
|> validate_length(:email, max: 160)
5151
|> maybe_validate_unique_email(opts)
5252
end

0 commit comments

Comments
 (0)