Next.js middleware with NextAuth server session?

What is the best way to write a Next.js middleware (middleware.ts) that redirects to /login if the user is not logged in? I'm using the t3 stack with db sessions
2 Replies
Pieter
Pieter3y ago
Securing pages and API routes | NextAuth.js
You can easily protect client and server side rendered pages and API routes with NextAuth.js.
hyperzone
hyperzoneOP3y ago
It only supports jwt sessions, im using db sessions
Want results from more Discord servers?
Add your server