auth-middleware@0.1.0
📦 remixView on GitHub →
✨ 6 features🔧 11 symbols
Summary
This release introduces a new pluggable authentication middleware package, `auth-middleware`, for `fetch-router`, providing several utilities for managing request authentication state. Dependencies, including `fetch-router`, have also been updated.
✨ New Features
- Added pluggable authentication middleware package `auth-middleware` for `fetch-router`.
- Introduced `Auth` context key and `AuthState` for reading request auth state via `context.get(Auth)`.
- Added `auth()` utility for resolving request authentication state using `context.get(Auth)`.
- Added `requireAuth()` utility for enforcing authenticated access with configurable failure responses.
- Added `WithAuth` and `WithRequiredAuth` for defining app-level request context contracts.
- Included built-in helpers: `createBearerTokenAuthScheme()`, `createAPIAuthScheme()`, and `createSessionAuthScheme()`.