-
Running: Here's the permalink to the Stack Trace on Vercel
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 12 replies
-
hi @ztanner In our application, Example of condition and redirect in const isMember = false
if (!isMember) {
return NextResponse.redirect(new URL('/plans', request.url));
}
Hoping we can get a patch soon! |
Beta Was this translation helpful? Give feedback.
-
Hi @ehis, thank you for the report! This should be fixed by #65097 which is available in |
Beta Was this translation helpful? Give feedback.
-
I came across to this problem as well, IMO, having the redirects at middleware level made more sense, instead of duplicating same logic in more than one place ( one at middle ware and others at each server action ). My dependencies: in the export function middleware(request: NextRequest) {
} export const config = { |
Beta Was this translation helpful? Give feedback.
@ehis, yep, no need to handle in middleware! You can think of it similar to an API route where you'd have the auth check at the top of the request handler.