fix(user): better regex and message for validate email
This commit is contained in:
parent
c1385df0f9
commit
c45d8e3ffd
1 changed files with 2 additions and 2 deletions
|
@ -33,8 +33,8 @@ defmodule LearningPhoenix.Accounts.User do
|
|||
changeset =
|
||||
changeset
|
||||
|> validate_required([:email])
|
||||
|> validate_format(:email, ~r/^[^@,;\s]+@[^@,;\s]+$/,
|
||||
message: "must have the @ sign and no spaces"
|
||||
|> validate_format(:email, ~r/^[^@,;\s]+@[^@,;\s]+\.[^@,;\s]+$/,
|
||||
message: "this is not a valid email address"
|
||||
)
|
||||
|> validate_length(:email, max: 160)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue