tfwright / live_admin

Low-config admin UI for Phoenix apps, built on LiveView
MIT License
257 stars 25 forks source link

Question on authentication #115

Closed asok closed 1 month ago

asok commented 1 month ago

Hi, first things first - I'm really a newbie in Elixir and Phoenix.

I wanted to use live_admin behind authentication. I've configured it and run mix phx.gen.auth Administration Admin admins. I've setup the router like so:

  scope "/", WowWeb do
    pipe_through [:browser, :require_authenticated_admin]

    live_session :require_authenticated_admin,
      on_mount: [{WowWeb.AdminAuth, :ensure_authenticated}] do
      live "/admins/settings", AdminSettingsLive, :edit
      live "/admins/settings/confirm_email/:token", AdminSettingsLive, :confirm_email
    end

    live_admin "/admin", title: "Wow Project"  do
      admin_resource "/users", Wow.Admin.User
    end
  end

Two questions: