Next (13.2.4) not redirect in build mode after set cookie
Unanswered
Ratonero Valenciano posted this in #help-forum
Ratonero ValencianoOP
'm trying to authorize through cookies and middleware. In dev mode, everything works fine. But in the assembly (npm run build) the redirect does not work after the cookies are set. I do not understand why in dev mode everything works as it should, but in the build the redirect does not work. In this case, cookies appear
5 Replies
you need to return the redirects
no idea why that even works in dev
Ratonero ValencianoOP
If I return a redirect, then I have an infinite redirect. Only works if I return NextResponse.next()
@Ratonero Valenciano If I return a redirect, then I have an infinite redirect. Only works if I return NextResponse.next()
then you arent redirecting. you either return next OR redirect. you need to fix your logic.
Ratonero ValencianoOP
Thx, bro. I fixed this â¤ï¸