github remix-run/remix auth-middleware@0.2.0
auth-middleware v0.2.0

latest releases: node-tsx@0.1.0, node-fetch-server@0.13.2, remix@3.0.0-beta.1...
5 hours ago

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

Don't miss a new remix release

NewReleases is sending notifications on new releases.