   end
 
   defp check_password(user, password) do
-    Logger.debug "Checking password: #{password}"
-
     Comeonin.Bcrypt.checkpw(password, user.password)
   end
 end

  end

  defp find_user_and_pass(username, password) do
    Logger.debug "Found username: #{username} password: #{password}"

    user = Repo.one(from u in User,
                    where: u.username == ^username,
                    select: u)

    if !is_nil(user) do
      Logger.debug "Testing #{user.username}:#{user.password}"
    end

    if check_password(user, password) do
      user


  alias Officetournament.Login
  alias Officetournament.User

  plug :scrub_params, "login" when action in [:create, :update]

