defmodule MyApp.Router do
...
pipeline :browser do
plug :accepts, ["html"]
plug :fetch_session
plug :fetch_live_flash
plug :put_root_layout, html: {MyAppWeb.Layouts, :root}
plug :protect_from_forgery
plug :put_secure_browser_headers
plug :load_from_session
end
pipeline :skip_csrf_protection do
plug(:accepts, ["html"])
plug(:fetch_session)
plug(:fetch_flash)
plug(:put_secure_browser_headers)
end
scope "/", MyAppWeb do
pipe_through(:skip_csrf_protection)
auth_routes_for(MyApp.Accounts.User, to: AuthController)
end
scope "/", MyAppWeb do
pipe_through :browser
sign_in_route()
sign_out_route(AuthController)
get "/", PageController, :home
end
...
end
defmodule MyApp.Router do
...
pipeline :browser do
plug :accepts, ["html"]
plug :fetch_session
plug :fetch_live_flash
plug :put_root_layout, html: {MyAppWeb.Layouts, :root}
plug :protect_from_forgery
plug :put_secure_browser_headers
plug :load_from_session
end
pipeline :skip_csrf_protection do
plug(:accepts, ["html"])
plug(:fetch_session)
plug(:fetch_flash)
plug(:put_secure_browser_headers)
end
scope "/", MyAppWeb do
pipe_through(:skip_csrf_protection)
auth_routes_for(MyApp.Accounts.User, to: AuthController)
end
scope "/", MyAppWeb do
pipe_through :browser
sign_in_route()
sign_out_route(AuthController)
get "/", PageController, :home
end
...
end