I tried using middleware.ts, but Prisma throws an error: PrismaClientValidationError: In order to run Prisma Client on edge runtime...
I understand middleware runs on the Edge runtime, so Prisma can’t be used there. But what’s the recommended way to implement elegant route protection with this stack?
Should I only check session/token inside middleware.ts and move DB checks to server components / API routes?
Or is there a better practice?
Which Discord would be best to ask this (Next.js, Prisma, or Auth.js)? Thanks a lot!