Middleware

J·2025년 5월 22일

Upgrade Guide (NextAuth.js v5)

요약

  1. next-auth/middleware is depreciated.
  2. matcher에 해당하는 url에 접근하면 redirect.

세부

how to setup middleware

Protecting Resources

// @/middleware.ts
export { auth as middleware } from "@/auth"

export const config = {
    matcher: [
        "/issues/new"
    ]
}

0개의 댓글