feat: add auth0 middleware
This commit is contained in:
14
middleware.ts
Normal file
14
middleware.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { withMiddlewareAuthRequired } from '@auth0/nextjs-auth0/edge';
|
||||
import { NextResponse } from 'next/server';
|
||||
|
||||
export default withMiddlewareAuthRequired({
|
||||
async middleware() {
|
||||
const res = NextResponse.next();
|
||||
return res;
|
||||
},
|
||||
returnTo: '/api/auth/login'
|
||||
});
|
||||
|
||||
export const config = {
|
||||
matcher: ['/api/protected/:path*', '/customer-form/:path*']
|
||||
};
|
||||
Reference in New Issue
Block a user