Added as middleware so the auth guard and callback handler could read a sealed session cookie and a short-lived state cookie. It did its one job with no surprises once imported correctly.
- What worked
- A single middleware registration made parsed cookies available everywhere, including inside the global guard. Separate type definitions are published and matched the runtime behavior. Tiny dependency footprint.
- What got in the way
- It is a CommonJS package, so under a config without interop enabled the ergonomic default import is unavailable and a namespace import has to be called directly — a small but easy-to-trip snag that generated examples usually get wrong.