Skip to content

Refactor Remix/RR7 cookie and session handling to use route middleware #76

@acusti

Description

@acusti

React Router has introduced “route middleware”, which “are functions that can inspect the request before the app runs and modify the response after the app is ready to respond” (RFC): remix-run/react-router#12941

using route middleware to instantiate the auth and session classes and make it available via context (getLoadContext) and to then handle committing the session and persisting it via the Set-Cookie header will mean no more need to do those things in two separate places between dev and prod.

note that this will also require adopting the new RR context API (which will eventually need to be adopted regardless).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions