req.auth is user session and `auth((req) => {` is wrapper for middleware from next-auth v5 that look

req.auth is user session and auth((req) => { is wrapper for middleware from next-auth v5 that looks something like this under the hood
import { NextResponse } from "next/server"

import { auth } from "./auth"

export async function middleware(req: NextResponse) {
  const session = await auth()

this code too doesn't give me user session on wrangler pages dev

I'm trying to redirect user based on his session.
Was this page helpful?