mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
fix(portal): Do not allow emails with just TLD in place (#6205)
`foo@bar` was a valid domain, while it's technically possible that somebody owns a TLD with MX records Stripe will not accept that, so we have to adopt this validation and make sure sign ups don't results in HTTP 500s.
This commit is contained in:
@@ -193,7 +193,7 @@ defmodule Domain.Repo.Changeset do
|
||||
|
||||
def validate_email(%Ecto.Changeset{} = changeset, field) do
|
||||
changeset
|
||||
|> validate_format(field, ~r/^[^\s]+@[^\s]+$/, message: "is an invalid email address")
|
||||
|> validate_format(field, ~r/^[^\s]+@[^\s]+\.[^\s]+$/, message: "is an invalid email address")
|
||||
|> validate_length(field, max: 160)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user