summaryrefslogtreecommitdiff
path: root/lib/chessh/auth/password.ex
blob: ea2c8fcdaad865ad0eda159f4109d3ac0b43198e (plain)
1
2
3
4
5
6
7
8
9
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