# `Wiztchta.Plug`
[🔗](https://github.com/darth-jorge/wiztcha/blob/v0.1.0/lib/wiztchta/plug.ex#L1)

Verifies the submitted challenge and stores the result in
`conn.assigns.wiztchta` as `:ok` or `{:error, reason}`.

The plug never halts; your action decides what to do:

    plug Wiztchta.Plug when action in [:create]

    def create(conn, params) do
      case conn.assigns.wiztchta do
        :ok -> ...
        {:error, reason} ->
          conn
          |> put_flash(:error, Wiztchta.error_message(reason))
          |> render(:new, ...)
      end
    end

Options are forwarded to `Wiztchta.verify/2`.

---

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