A unique middleware implementation supporting all above targets, and more on the way
Background
lucia-auth HTTP middlewares are currently only documented and not part of the API. Also, current documentation lacks supports for popular servers, such as Hono.
Supporting those middlewares is non trivial, time consuming and bug-prone, and I assume those are the main reasons that they are currently not part of the API.
Proposal
I created universal-middleware with the goal to alleviate those specific issues for library authors. You can think of it as unplugin for HTTP middlewares.
By creating a universal standard-based middleware, you can support any servers and frameworks supported by universal-middleware.
universal-middleware can also auto-compile directly any universal middleware and handler to all its supported targets. I invite you to take a look at the documentation examples, so that you can see how easy it would be for users to use such compiled middlewares.
Implementing each middleware is trivial and I don't see really see it as a problem to solve. Don't want to add more maintenance burden to the project either
Package
lucia
Goals
Background
lucia-auth
HTTP middlewares are currently only documented and not part of the API. Also, current documentation lacks supports for popular servers, such as Hono. Supporting those middlewares is non trivial, time consuming and bug-prone, and I assume those are the main reasons that they are currently not part of the API.Proposal
I created universal-middleware with the goal to alleviate those specific issues for library authors. You can think of it as unplugin for HTTP middlewares.
By creating a universal standard-based middleware, you can support any servers and frameworks supported by
universal-middleware
.As an example, batijs.dev already supports
lucia-auth
thanks touniversal-middleware
. You can check the middlewares and handlers that are currently implemented, and their usage in express for instance.universal-middleware
can also auto-compile directly any universal middleware and handler to all its supported targets. I invite you to take a look at the documentation examples, so that you can see how easy it would be for users to use such compiled middlewares.