summaryrefslogtreecommitdiff
path: root/lib/chessh/schema
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chessh/schema')
-rw-r--r--lib/chessh/schema/key.ex1
-rw-r--r--lib/chessh/schema/player.ex2
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/chessh/schema/key.ex b/lib/chessh/schema/key.ex
index f8c14cf..765c83b 100644
--- a/lib/chessh/schema/key.ex
+++ b/lib/chessh/schema/key.ex
@@ -32,6 +32,7 @@ defmodule Chessh.Key do
if is_tuple(key) do
case key do
{pub, [opts]} -> [{pub, [opts]}]
+ {pub, []} -> [{pub, [comment: '']}]
key -> [{key, [comment: '']}]
end
|> :ssh_file.encode(:openssh_key)
diff --git a/lib/chessh/schema/player.ex b/lib/chessh/schema/player.ex
index d04ed3e..5b7b904 100644
--- a/lib/chessh/schema/player.ex
+++ b/lib/chessh/schema/player.ex
@@ -49,7 +49,7 @@ defmodule Chessh.Player do
defp validate_username(changeset) do
changeset
|> validate_required([:username])
- |> validate_length(:username, min: 2, max: 12)
+ |> validate_length(:username, min: 2, max: 16)
|> validate_format(:username, ~r/^[a-zA-Z0-9_\-]*$/,
message: "only letters, numbers, underscores, and hyphens allowed"
)