summaryrefslogtreecommitdiff
path: root/lib/chessh/auth/password.ex
diff options
context:
space:
mode:
authorSimponic <loganhunt@simponic.xyz>2022-12-19 20:45:01 -0700
committerSimponic <loganhunt@simponic.xyz>2022-12-19 20:45:01 -0700
commit110eb0b1990d5d5ee77f9368a9b7653cfdc07131 (patch)
treebfe5744255cdfbdc9412d148236a2bf5f8aad7c1 /lib/chessh/auth/password.ex
parentfe661a935ac887b11aec31ff049ace2db7ccbf84 (diff)
downloadchessh-110eb0b1990d5d5ee77f9368a9b7653cfdc07131.tar.gz
chessh-110eb0b1990d5d5ee77f9368a9b7653cfdc07131.zip
Implement public key and add tests
Diffstat (limited to 'lib/chessh/auth/password.ex')
-rw-r--r--lib/chessh/auth/password.ex4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/chessh/auth/password.ex b/lib/chessh/auth/password.ex
index a6fa73d..48a4d62 100644
--- a/lib/chessh/auth/password.ex
+++ b/lib/chessh/auth/password.ex
@@ -2,11 +2,11 @@ defmodule Chessh.Auth.PasswordAuthenticator do
alias Chessh.Player
alias Chessh.Repo
use Sshd.PasswordAuthenticator
+ require Logger
def authenticate(username, password) do
case Repo.get_by(Player, username: String.Chars.to_string(username)) do
- nil -> false
- x -> Player.valid_password?(x, password)
+ x -> Player.valid_password?(x, String.Chars.to_string(password))
end
end
end