z4nr34l / next-easy-middlewares

Missing polyfill for multiple next.js middlewares
https://next-easy-middlewares.vercel.app/
MIT License
84 stars 4 forks source link

withAuth issue from next-auth/middleware #51

Open xlCyanz opened 3 weeks ago

xlCyanz commented 3 weeks ago

Describe the bug Recently, I saw this package and found it interesting that it allows assigning multiple middlewares to a single record. However, when trying to use the middleware from the "next-auth/middleware" package called withAuth, the page throws an error related to createMiddleware. (Sorry for my english)

To Reproduce Steps to reproduce the behavior:

  1. Go to 'middleware.ts'
  2. Follow a basic example to apply the package
  3. Place the withAuth in the api route.
  4. See error

Expected behavior Redirect unauthorized users

Screenshots image

Desktop (please complete the following information):

linear[bot] commented 3 weeks ago

NEM-19 withAuth issue from next-auth/middleware

z4nr34l commented 2 days ago

Please give me version of packages that you're using:

Also please share your middleware.ts file with me.

That would help a lot :D