darth0sπΊ
KKinde
β’Created by darth0sπΊ on 2/12/2025 in #π»βsupport
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
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/landing
Question is, what I am doing wrong that when I am not auth localhost:3000
is not redirecting properly and requries auth
Would really appreciate help as it looks I've fallen into some antipattern and cannot see through the tunnel vision π5 replies