2021-03-19 19:32:18 +00:00
|
|
|
defmodule Legendary.Content.Router do
|
|
|
|
use Legendary.Content, :router
|
|
|
|
alias Legendary.AuthWeb.Plugs.{RequireAdmin}
|
2020-07-22 19:22:44 +00:00
|
|
|
|
|
|
|
pipeline :browser do
|
|
|
|
plug :accepts, ["html"]
|
|
|
|
plug :fetch_session
|
|
|
|
plug :fetch_flash
|
|
|
|
plug :protect_from_forgery
|
|
|
|
plug :put_secure_browser_headers
|
|
|
|
end
|
|
|
|
|
|
|
|
pipeline :api do
|
|
|
|
plug :accepts, ["json"]
|
|
|
|
end
|
|
|
|
|
|
|
|
pipeline :require_admin do
|
|
|
|
plug(RequireAdmin)
|
|
|
|
end
|
|
|
|
|
2020-09-30 20:10:17 +00:00
|
|
|
pipeline :require_auth do
|
|
|
|
plug Pow.Plug.RequireAuthenticated, error_handler: Pow.Phoenix.PlugErrorHandler
|
2020-07-22 19:22:44 +00:00
|
|
|
end
|
|
|
|
|
2021-03-19 19:32:18 +00:00
|
|
|
use Legendary.Content.Routes
|
2020-07-22 19:22:44 +00:00
|
|
|
end
|