View Source PowAssent.Phoenix.Router (PowAssent v0.4.18)

Handles Phoenix routing for PowAssent.

Usage

Configure lib/my_project_web/router.ex the following way:

defmodule MyAppWeb.Router do
  use MyAppWeb, :router
  use Pow.Phoenix.Router
  use PowAssent.Phoenix.Router

  # ...

  pipeline :skip_csrf_protection do
    plug :accepts, ["html"]
    plug :fetch_session
    plug :fetch_flash
    plug :put_secure_browser_headers
  end

  scope "/" do
    pipe_through :skip_csrf_protection

    pow_assent_authorization_post_callback_routes()
  end

  scope "/" do
    pipe_through :browser

    pow_routes()
    pow_assent_routes()
  end

  # ...
end

The :skip_csrf_protection pipeline and pow_assent_authorization_post_callback_routes/0 call is only necessary if you have strategies using POST callback such as Assent.Strategy.Apple. The default CSRF protection in Phoenix has to be skipped when using POST callback.

Summary

Functions

PowAssent router macro.

Functions

Link to this macro

pow_assent_routes()

View Source (macro)

PowAssent router macro.

Use this macro to define the PowAssent routes.

Example

scope "/" do
  pow_assent_routes()
end