View Source Pow.Extension.Phoenix.Router.Base behaviour (Pow v1.0.38)

Used for extensions to extend routes.

Usage

defmodule MyPowExtension.Phoenix.Router do
  use Pow.Extension.Phoenix.Router.Base

  defmacro routes(_config) do
    quote location: :keep do
      resources "/reset-password", TestController, only: [:new]
    end
  end
end

A macro MyPowExtension.Phoenix.Router.scoped_routes/1 will be created that wraps the routes inside a scope with the extension as namespace similar to:

scope "/", MyPowExtension.Phoenix, as: "my_pow_extension" do
  MyPowExtension.Phoenix.Router.routes(config)
end

Summary

Callbacks

@macrocallback routes(Pow.Config.t()) :: Macro.t()