- Add Legal Office of the Master seal (SVG design with Maltese Cross, scales of justice, legal scroll) - Create legal-office-manifest-template.json for Legal Office credentials - Update SEAL_MAPPING.md and DESIGN_GUIDE.md with Legal Office seal documentation - Complete Azure CDN infrastructure deployment: - Resource group, storage account, and container created - 17 PNG seal files uploaded to Azure Blob Storage - All manifest templates updated with Azure URLs - Configuration files generated (azure-cdn-config.env) - Add comprehensive Azure CDN setup scripts and documentation - Fix manifest URL generation to prevent double slashes - Verify all seals accessible via HTTPS
28 lines
868 B
TypeScript
28 lines
868 B
TypeScript
import { NextResponse } from 'next/server';
|
|
import type { NextRequest } from 'next/server';
|
|
|
|
export function middleware(request: NextRequest): NextResponse {
|
|
// Public portal routes are generally open
|
|
// Only protect specific routes if needed
|
|
const protectedRoutes: string[] = []; // Add protected routes here if needed
|
|
|
|
const isProtectedRoute = protectedRoutes.some((route) => request.nextUrl.pathname.startsWith(route));
|
|
|
|
if (isProtectedRoute) {
|
|
const token = request.cookies.get('auth_token') || request.headers.get('authorization');
|
|
|
|
if (!token) {
|
|
const loginUrl = new URL('/login', request.url);
|
|
loginUrl.searchParams.set('redirect', request.nextUrl.pathname);
|
|
return NextResponse.redirect(loginUrl);
|
|
}
|
|
}
|
|
|
|
return NextResponse.next();
|
|
}
|
|
|
|
export const config = {
|
|
matcher: [], // Add protected routes here if needed
|
|
};
|
|
|