# `PhoenixCap.Plug`
[🔗](https://github.com/elchemista/phoenix_cap/blob/v0.1.0/lib/phoenix_cap/plug.ex#L1)

Cap challenge and redemption endpoint with self-hosted widget assets.

    forward "/cap", PhoenixCap.Plug

Forward the route outside the browser pipeline so the widget can send its
challenge and redemption requests. Protect the action that consumes the
token with your app's usual pipeline.

# `call`

```elixir
@spec call(Plug.Conn.t(), keyword()) :: Plug.Conn.t()
```

Serves widget assets and handles the relative `POST /challenge` and `POST /redeem` paths.

# `init`

```elixir
@spec init(keyword()) :: keyword()
```

Accepts the options supplied to the forwarded Plug.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
