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:
is this the right way to do auth?
if yes, how can I place the "log out" link in the live layout? phx.gen.auth generate layouts under components/layouts/ dir. But it seems that live_admin is using it's own layouts.
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:Two questions:
phx.gen.auth
generate layouts undercomponents/layouts/
dir. But it seems that live_admin is using it's own layouts.