Change8

auth-middleware@0.2.0

Breaking Changes
📦 remixView on GitHub →
1 breaking2 features🔧 6 symbols

Summary

This release removes deprecated context helper types and updates how authentication state is installed and narrowed within request contexts. Dependencies across `@remix-run/*` packages have also been bumped.

⚠️ Breaking Changes

  • Removed the `ContextWithAuth` and `ContextWithRequiredAuth` helper types. Fix by deriving auth-aware request context from the actual auth middleware tuple using `MiddlewareContext`, or use the core `ContextWithEntry` helper when manually composing context types without a middleware tuple.

Migration Steps

  1. If using `ContextWithAuth` or `ContextWithRequiredAuth`, replace them by deriving context using `MiddlewareContext` with the actual auth middleware tuple, or use `ContextWithEntry`.

✨ New Features

  • `auth()` now installs resolved auth state as `context.auth` in addition to `context.get(Auth)`.
  • `requireAuth()` narrows `context.auth` and `context.get(Auth)` to `GoodAuth<identity>` for protected handlers.

Affected Symbols