ueberauth / guardian

Elixir Authentication
MIT License
3.4k stars 381 forks source link

missing index/2 in PageController #671

Closed ahsf closed 3 years ago

ahsf commented 3 years ago

Getting Started does not work, because this is not defined:

  # Maybe logged in routes
  scope "/", AuthMeWeb do
    pipe_through [:browser, :auth]

    get "/", PageController, :index <---- not defined in PageController!

So either change this

## lib/auth_me_web/controllers/page_controller.ex

defmodule AuthMeWeb.PageController do
  use AuthMeWeb, :controller

  def protected(conn, _) do
    user = Guardian.Plug.current_resource(conn)
    render(conn, "protected.html", current_user: user)
  end
end

to

"add this to PageController"

  def protected(conn, _) do
    user = Guardian.Plug.current_resource(conn)
    render(conn, "protected.html", current_user: user)
  end

or add add index/2 (like in the PR).

yordis commented 3 years ago

🚀 thank you so much!