# `Sigra.Plug.RequireAuthenticated`
[🔗](https://github.com/sztheory/sigra/blob/v1.20.0/lib/sigra/plug/require_authenticated.ex#L1)

Authentication gate plug that halts unauthenticated requests.

This plug checks for `conn.assigns.current_scope`. If present, the request
passes through unchanged. If absent (nil), the configured error handler is
called with `:unauthenticated` and the connection is halted.

## Options

  * `:error_handler` - Module implementing `Sigra.Plug.ErrorHandler`.
    Required.

## Example

    plug Sigra.Plug.RequireAuthenticated,
      error_handler: MyAppWeb.AuthErrorHandler

# `call`
*since 0.1.0* 

Check for authenticated user and halt if not present.

# `init`
*since 0.1.0* 

Initialize the plug with the given options.

---

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