first commit

This commit is contained in:
Your NamebaishaliHolocron
2026-06-15 12:57:03 +05:30
commit b9ac5ae0b2
398 changed files with 49583 additions and 0 deletions

28
frontend/app/proxy.ts Normal file
View File

@@ -0,0 +1,28 @@
import { NextRequest, NextResponse } from "next/server";
export async function middleware(req: NextRequest) {
const { pathname } = req.nextUrl;
const publicRoutes = ["/login.html"];
const isPublic = publicRoutes.some(route =>
pathname.startsWith(route)
);
// EDGE-SAFE: read cookie only
const token = req.cookies.get("ikoncloud_next_accessToken")?.value;
if (!isPublic && !token) {
const url = req.nextUrl.clone();
url.pathname = "/login.html";
return NextResponse.redirect(url);
}
return NextResponse.next();
}
export const config = {
matcher: [
"/((?!_next/static|_next/image|favicon.ico).*)",
],
};