Pow v1.0.10 Pow.Phoenix.Router View Source
Handles Phoenix routing for Pow.
Resources are build with pow_resources/3
and individual routes are build
with pow_route/5
. The Pow routes will be filtered if a route has already
been defined with the same action and router helper alias. This makes it easy
to override pow routes with no conflicts.
The scope will be validated to ensure that there is no aliases. An exception will be raised if an alias was defined in any scope around the pow routes.
Usage
Configure lib/my_project_web/router.ex
the following way:
defmodule MyAppWeb.Router do
use MyAppWeb, :router
use Pow.Phoenix.Router
pipeline :browser do
plug :accepts, ["html"]
plug :fetch_session
plug :fetch_flash
plug :protect_from_forgery
plug :put_secure_browser_headers
end
scope "/" do
pipe_through :browser
pow_routes()
end
# ...
end
Link to this section Summary
Link to this section Functions
Link to this macro
pow_route(verb, path, plug, plug_opts, options \\ []) View Source (macro)
Link to this macro
pow_routes() View Source (macro)
Pow routes macro.
Use this macro to define the Pow routes. This will call
pow_session_routes/0
and pow_registration_routes/0
.
Example
scope "/" do
pow_routes()
end
Link to this function