Unable to visit /admin/*
i have a nextjs app that has an admin page with sub pages like /admin/upload /admin/store etc, it all works in localhost, but in prod i get this behaviour, where clicking on the pages, or navigating via the url sends you back to /admin/ any ideas on what it is? im using app router and protecting with
matcher: ["/admin/:path*"]
in middleware11 Replies
Hey, i'm assuming you're using the NextJS SDK. Could you please tell me your sdk version and maybe share the code of your middleware ?
in debugging all this i brought my middleware to the simpliet it could be at
and im using the nextjs sdk 2.3.8
Well this is weird because what it should be doing is send you to the kinde auth screen if you were not authenticated. Maybe it has something to do with you components / layout ? Do you have any other place where you redirect the users ?
i dont redirect or anything, and i will admit that its some bad code, but notrhing that should be causing this, especially since the user is already authenticated, and it only happens on prod, on localhost it behaves as normal
This is weird. Maybe one token is getting lost somewhere or some. Have you tried to debug using the console in prod ? Like network tab, check the cookies, etc ?
Let me ask the team too
i’ll try that when i get back, and if you need access to the repo i can give it
Hey @theo just checking if you got anything new ?
this is what happens with my cookies, and the logs just show 200s but i dont know if that is normal behaviour
This is some odd behavior. May you give me a quick access to your repo ?
since its a school project it has to be in a private repo can i just add you to it
yes