You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A unique middleware implementation supporting all above targets, and more on the way
Non-Goals
No response
Background
Auth.js middleware currently supports a few servers and frameworks, each having their own implementation, package, etc. inducing a maintenance cost.
Supporting other middleware targets is non trivial currently, time consuming and bug-prone.
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 is more meaningful, here is what actually look like the complete Auth.js universal handler:
universal-middleware can 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.
As an example, batijs.dev already supports Auth.js thanks to universal-middleware sub packages (such as @universal-middleware/express, @universal-middleware/hono, etc.), and is heavily tested with all servers.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
Non-Goals
No response
Background
Auth.js
middleware currently supports a few servers and frameworks, each having their own implementation, package, etc. inducing a maintenance cost.Supporting other middleware targets is non trivial currently, time consuming and bug-prone.
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 is more meaningful, here is what actually look like the complete
Auth.js
universal handler:I have a working example of using this universal handler in my fork, with tests passing. The fork implementation have all the
@auth/express
features implemented and tested under the newframeworks-universal
directory.universal-middleware
can 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.As an example, batijs.dev already supports
Auth.js
thanks touniversal-middleware
sub packages (such as@universal-middleware/express
,@universal-middleware/hono
, etc.), and is heavily tested with all servers.Beta Was this translation helpful? Give feedback.
All reactions