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

Requires a valid `cap-token` request parameter. A successful check consumes
the token and continues the pipeline. A failed check sends HTTP 422 and halts.

Controllers can install this plug using `use PhoenixCap`. The optional
`:only` list selects Phoenix controller actions by name.

# `call`

```elixir
@spec call(Plug.Conn.t(), :all | [atom()]) :: Plug.Conn.t()
```

Checks the parsed top-level `cap-token` parameter before a protected action runs.

# `init`

```elixir
@spec init(keyword()) :: :all | [atom()]
```

Selects all controller actions by default, or the actions named in `:only`.

---

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