Hello everyone, I have the following code:
export function middleware(request: NextRequest) {
console.log('middleware run')
const cookies = request.cookies.getAll()
if(!cookies.length){
redirect("/auth/login")
}
// return NextResponse.next()
}
As it says in the title, I'm getting a "NEXT_REDIRECT" error on my middleware when the user is not authenticated.
I would expect to get redirected to the URL I specificied instead.
Any ideas why this is happening ?