Commit 668b01da authored by dtluna's avatar dtluna
Browse files

Add restriction on names

parent a3b9741a
...@@ -63,6 +63,7 @@ def register_changeset(struct, params \\ %{}) do ...@@ -63,6 +63,7 @@ def register_changeset(struct, params \\ %{}) do
|> validate_confirmation(:password) |> validate_confirmation(:password)
|> unique_constraint(:email) |> unique_constraint(:email)
|> unique_constraint(:nickname) |> unique_constraint(:nickname)
|> validate_format(:nickname, ~r/^[a-zA-Z\d]+$/)
if changeset.valid? do if changeset.valid? do
hashed = Comeonin.Pbkdf2.hashpwsalt(changeset.changes[:password]) hashed = Comeonin.Pbkdf2.hashpwsalt(changeset.changes[:password])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment