UPD: initial architecture
CI / quality (push) Waiting to run

This commit is contained in:
Uklonil
2026-07-27 10:23:50 +02:00
parent 63fc0e6771
commit 3aeaed0af2
108 changed files with 11103 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
import { NextResponse, type NextRequest } from "next/server";
export function middleware(request: NextRequest) {
if (request.nextUrl.pathname.startsWith("/w/")) {
const hasSessionCookie = request.cookies
.getAll()
.some((cookie) => cookie.name.includes("session_token"));
if (!hasSessionCookie)
return NextResponse.redirect(
new URL(`/login?next=${encodeURIComponent(request.nextUrl.pathname)}`, request.url),
);
}
return NextResponse.next();
}
export const config = { matcher: ["/w/:path*"] };