Files
Rémi Bouteiller 306fd8741b style: apply repo-wide biome rewrites
Capture the repo-wide Biome formatting pass and fold the tiny BMP palette helpers back into render-bmp.ts so the monochrome palette fix stays self-contained.

Made-with: Cursor
2026-04-24 11:20:18 -07:00

38 lines
816 B
TypeScript

import { headers } from "next/headers";
import { NextRequest, NextResponse } from "next/server";
import { auth } from "@/lib/auth/auth";
// Paths that don't require authentication
const PUBLIC_PATHS = [
"/api",
"/_next",
"/favicon.ico",
"/sign-in",
"/sign-up",
"/recover",
];
export async function proxy(request: NextRequest) {
const { pathname } = request.nextUrl;
// Skip auth for public paths
if (PUBLIC_PATHS.some((path) => pathname.startsWith(path))) {
return NextResponse.next();
}
// Skip auth check if authentication is disabled (mono-user mode)
if (!auth) {
return NextResponse.next();
}
const session = await auth.api.getSession({
headers: await headers(),
});
if (!session) {
return NextResponse.redirect(new URL("/sign-in", request.url));
}
return NextResponse.next();
}