Initial commit
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
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*'],
|
||||
};
|
||||
Reference in New Issue
Block a user