T3 Stack · Concept
Middleware
T3 Stack authentication middleware uses Next.js middleware and an authorized callback to protect pages and requests. Middleware is an early check, so authorization must also be verified near data fetching.
Last updated
Syntax
export { auth as middleware } from "@/auth"In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
Next.js middlewareNextAuth.jsauthorized callbackauthNextResponsesession verification