---
title: "RequireAuthOptions"
source: "https://github.com/remix-run/remix/blob/8905f3943706e1f53696ab83e70a84873cabfc90/packages/auth-middleware/src/lib/require-auth.ts#L8"
---

# RequireAuthOptions

## Summary

Options for enforcing authentication on a route.

## Signature

```ts
interface RequireAuthOptions {
  onFailure?: (context: RequestContext, auth: BadAuth) => Response | Promise<Response>
}

```

## Properties

### `onFailure`

Custom response builder for unauthenticated requests.