Skip to content

Latest commit

 

History

History
79 lines (48 loc) · 2.78 KB

File metadata and controls

79 lines (48 loc) · 2.78 KB

auth-middleware CHANGELOG

This is the changelog for auth-middleware. It follows semantic versioning.

v0.2.3

Patch Changes

v0.2.2

Patch Changes

v0.2.1

Patch Changes

v0.2.0

Minor Changes

  • BREAKING CHANGE: Removed the ContextWithAuth and ContextWithRequiredAuth helper types. Derive auth-aware request context from the actual auth middleware tuple with MiddlewareContext, or use the core ContextWithEntry helper when manually composing context types without a middleware tuple.

    import { requireAuth } from 'remix/auth-middleware'
    import type { MiddlewareContext } from 'remix/fetch-router'
    
    let protectedMiddleware = [requireAuth<AuthIdentity>()] as const
    type AppAuthContext = MiddlewareContext<typeof protectedMiddleware, AppContext>
  • 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.

Patch Changes

v0.1.2

Patch Changes

v0.1.1

Patch Changes

v0.1.0

Minor Changes

  • Add auth-middleware, a pluggable authentication middleware package for fetch-router.

    Includes:

    • the Auth context key and AuthState for reading request auth state with context.get(Auth)
    • auth() for resolving request authentication state with context.get(Auth)
    • requireAuth() for enforcing authenticated access with configurable failure responses
    • WithAuth and WithRequiredAuth for app-level request context contracts
    • built-in createBearerTokenAuthScheme(), createAPIAuthScheme(), and createSessionAuthScheme() helpers

Patch Changes