Files
sexy/proxy.ts
T
valknarandClaude Sonnet 5 f7503d03d0
CI / Static checks (push) Successful in 1m9s
CI / Build and push image (push) Failing after 1m2s
Restyle UI with a channel-strip console look and brand icon
Adds a pink/purple/blue SVG brand mark (favicon + header) and reworks
the visual language around the app's actual interaction - fader-driven
device control - via LED-style indicators, mono instrument readouts,
hairline-framed cards, console-tab nav, and an oscilloscope-style
session timeline. Leaves components/ui/* untouched, restyling only via
design tokens and the app's own composed components. Also fixes a
proxy.ts matcher gap that was gating /icon.svg behind auth.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W8WkFF5ppURBAB918593Eb
2026-08-25 16:43:28 +02:00

27 lines
872 B
TypeScript

import { NextRequest, NextResponse } from "next/server";
import { SESSION_COOKIE_NAME, verifySessionToken } from "@/lib/auth/session";
export default async function proxy(req: NextRequest) {
const { pathname } = req.nextUrl;
const isAuthenticated = await verifySessionToken(req.cookies.get(SESSION_COOKIE_NAME)?.value);
if (isAuthenticated) {
if (pathname === "/login") {
return NextResponse.redirect(new URL("/", req.url));
}
return NextResponse.next();
}
if (pathname.startsWith("/api/")) {
return NextResponse.json({ error: "unauthorized" }, { status: 401 });
}
const loginUrl = new URL("/login", req.url);
loginUrl.searchParams.set("from", pathname);
return NextResponse.redirect(loginUrl);
}
export const config = {
matcher: ["/((?!_next/static|_next/image|favicon.ico|icon.svg|login|api/auth/login|api/health).*)"],
};