Files
2026-03-18 18:26:24 +08:00

14 lines
400 B
TypeScript

import { withMiddlewareAuthRequired } from '@auth0/nextjs-auth0/edge';
import { NextRequest, NextResponse } from 'next/server';
export default function middleware(request: NextRequest) {
if (request.nextUrl.pathname.startsWith('/admin')) {
return withMiddlewareAuthRequired()(request, {} as never);
}
return NextResponse.next();
}
export const config = {
matcher: ['/admin/:path*'],
};