Implement per-user post permissions and move stats into dedicated pages

This commit is contained in:
爱喝水的木子
2026-03-20 11:51:58 +08:00
parent 17f5f6adcb
commit 466b7c3fb6
29 changed files with 1416 additions and 475 deletions

View File

@@ -7,6 +7,7 @@ export async function middleware(req: NextRequest) {
const isProtected =
pathname.startsWith("/admin") ||
pathname.startsWith("/stats") ||
pathname.startsWith("/api/admin") ||
pathname.startsWith("/api/posts") && req.method !== "GET";
@@ -30,5 +31,5 @@ export async function middleware(req: NextRequest) {
}
export const config = {
matcher: ["/admin/:path*", "/api/admin/:path*", "/api/posts/:path*"]
matcher: ["/admin/:path*", "/stats/:path*", "/api/admin/:path*", "/api/posts/:path*"]
};