summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/chessh/auth/password.ex2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/chessh/auth/password.ex b/lib/chessh/auth/password.ex
index 0986169..d9c32c4 100644
--- a/lib/chessh/auth/password.ex
+++ b/lib/chessh/auth/password.ex
@@ -5,6 +5,8 @@ defmodule Chessh.Auth.PasswordAuthenticator do
Player.valid_password?(player, password)
end
+ def authenticate(username, _password) when is_nil(username), do: false
+
def authenticate(username, password) do
case Repo.get_by(Player, username: username) do
player -> authenticate(player, password)