diff --git a/lib/philomena_web/router.ex b/lib/philomena_web/router.ex index 2ce39da1..d444a95c 100644 --- a/lib/philomena_web/router.ex +++ b/lib/philomena_web/router.ex @@ -145,6 +145,15 @@ defmodule PhilomenaWeb.Router do end end + scope "/", PhilomenaWeb do + pipe_through [:browser, :ensure_totp, :ensure_tor_authorized] + + # A curiosity due to the fact that Phoenix routes cannot have constraints + scope "/channels", Channel, as: :channel do + resources "/nsfw", NsfwController, only: [:create, :delete], singleton: true + end + end + scope "/", PhilomenaWeb do pipe_through [:browser, :ensure_totp, :protected] @@ -488,10 +497,6 @@ defmodule PhilomenaWeb.Router do resources "/history", Page.HistoryController, only: [:index] end - scope "/channels", Channel, as: :channel do - resources "/nsfw", NsfwController, only: [:create, :delete], singleton: true - end - resources "/dnp", DnpEntryController, only: [:index, :show] resources "/staff", StaffController, only: [:index] resources "/stats", StatController, only: [:index]