diff --git a/lib/microwaveprop_web/router.ex b/lib/microwaveprop_web/router.ex index 59082d4d..3414831f 100644 --- a/lib/microwaveprop_web/router.ex +++ b/lib/microwaveprop_web/router.ex @@ -76,12 +76,13 @@ defmodule MicrowavepropWeb.Router do # end scope "/" do - pipe_through :browser + pipe_through [:browser, :require_authenticated_user] - live_dashboard "/dashboard", + live_dashboard "/admin/dashboard", metrics: MicrowavepropWeb.Telemetry, ecto_repos: [Microwaveprop.Repo], - ecto_psql_extras_options: [long_running_queries: [threshold: "200 milliseconds"]] + ecto_psql_extras_options: [long_running_queries: [threshold: "200 milliseconds"]], + on_mount: [{MicrowavepropWeb.UserAuth, :require_admin}] end # Enable Swoosh mailbox preview in development