   end
 
   def repo(conn, %{"user" => org, "repo" => repo}) do
-    access_token = get_session(conn, :access_token)
     user = get_session(conn, :user)
-    client = Tentacat.Client.new(%{access_token: access_token})
-    prs = Tentacat.Pulls.filter org, repo, %{state: "open"}, client
+    client = github_client(conn)
+    prs = pull_requests(client, org, repo)
+
+    IO.inspect(client)
 
     render conn, "repo.html", %{org: org, repo: repo, prs: prs}
   end

    |> redirect(to: "/repos/#{org}/#{repo}")
  end

  def repositories_for_login(client, login) do
    Tentacat.get("users/#{login}/repos", client, %{per_page: 100})
  end
end

    user = get_session(conn, :user)

    if access_token do
      client = github_client(access_token)
      repositories = repositories_for_login(client, user.login)
    end

