chessh/lib/chessh/auth/password.ex
2022-12-29 17:21:20 -07:00

10 lines
237 B
Elixir

defmodule Chessh.Auth.PasswordAuthenticator do
alias Chessh.{Player, Repo}
def authenticate(username, password) do
case Repo.get_by(Player, username: username) do
x -> Player.valid_password?(x, password)
end
end
end