How to handle root redirect before Auth and i18n case
Hello,
I'm pretty stuck on trying to handle multiple things at the same time in the middleware. My stack is NextJS 15, next-international, Kinde.
my folder structure is like this:
My goal is to protect everything in auth and allow users to freely access landing page while still being able to handle i18n
* accessing
* accessing
* when I access
Unfortunately
Question is, what I am doing wrong that when I am not auth
Would really appreciate help as it looks I've fallen into some antipattern and cannot see through the tunnel vision
I'm pretty stuck on trying to handle multiple things at the same time in the middleware. My stack is NextJS 15, next-international, Kinde.
my folder structure is like this:
My goal is to protect everything in auth and allow users to freely access landing page while still being able to handle i18n
* accessing
localhost:3000/wallets - everything works fine, auth works, i18n works* accessing
localhost:3000/en/landing - everything works fine, no auth needed* when I access
localhost:3000 my expectation is that traffic is redirected to /app/landing (same as localhost:3000/en/landing) and no auth would be needed. Unfortunately
localhost:3000 pops auth window. When user is logged in, it redirects properly to localhost:3000/en/landingQuestion is, what I am doing wrong that when I am not auth
localhost:3000 is not redirecting properly and requries authWould really appreciate help as it looks I've fallen into some antipattern and cannot see through the tunnel vision