mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29:06 +00:00
FIEF NextJS
This commit is contained in:
20
www/middleware.ts
Normal file
20
www/middleware.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import type { NextRequest } from "next/server";
|
||||
|
||||
import { fiefAuth } from "./app/lib/fief";
|
||||
|
||||
const authMiddleware = fiefAuth.middleware([
|
||||
{
|
||||
matcher: "/private",
|
||||
parameters: {},
|
||||
},
|
||||
{
|
||||
matcher: "/castles/:path*",
|
||||
parameters: {
|
||||
permissions: ["castles:read"],
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
export async function middleware(request: NextRequest) {
|
||||
return authMiddleware(request);
|
||||
}
|
||||
Reference in New Issue
Block a user