Hi, today I generated a new auth admin in my phoenix 1.7.7 app
mix phx.gen.auth Accounts Admin admins
and after creating a new admin using the built-in form everything seems to be alright. Well.. almost everything. When logged in, the admin token is seen
session: %{
"_csrf_token" => "qWmAvVGzs...",
"admin_return_to" => "/dashboard",
"admin_token" => <<195, 253, (...)>>,
"live_socket_id" => "admins_sessions:w_3CYZGonln4 ..."
}
and following a page, for example admins/log_in successfully redirect to /. The problem is that the routes which require authenticated admin still require it. I am clicking on the settings button which goes to /admins/settings and the toast says me I need to log in, but i was already logged in. I tried to put different route in that scope, but the error still remains with the “new” live route.
scope "/", TennisWeb do
pipe_through([:browser, :require_authenticated_admin])
live_session :require_authenticated_admin,
on_mount: [{TennisWeb.AdminAuth, :ensure_authenticated}] do
live("/admins/settings", AdminSettingsLive, :edit)
live("/admins/settings/confirm_email/:token", AdminSettingsLive, :confirm_email)
end
end
I have no idea what could be wrong. For sure the wrong is with me, but what could it be?
Best Regards






















