Middleware based protection not working
in my middleware.ts, i have the following code
however, it simply doesnt protect any routes, while page based protection does work, however i want to avoid using that
4 Replies
Hi Theo. I'll check with one of our team who is experienced with Next.js and get back to you.
does the console log pop up in your terminal?
Just checking that the middleware is running
1. check the middleware is running -> you can remove withAuth and then just have it be a log to see if it is running on the /admin and /about routes. If not running then you have to move the file into the root directory
2. If it is running, then it could be a bug because your code looks good. Raise a quick issue and I'll jump in and I'll try and resolve it 😄
i had the middleware in app/ rather than src/ im so sorry thank you!!!!
Great, let us know if you need any further help