initial commit

This commit is contained in:
jason
2026-03-12 17:09:22 -05:00
commit 4982e5392e
35 changed files with 9803 additions and 0 deletions

25
src/middleware.ts Normal file
View File

@@ -0,0 +1,25 @@
import { NextRequest, NextResponse } from "next/server";
export function middleware(request: NextRequest) {
// Simple check for auth routes or static files
if (
request.nextUrl.pathname.startsWith('/api/auth') ||
request.nextUrl.pathname.startsWith('/_next') ||
request.nextUrl.pathname === '/favicon.ico'
) {
return NextResponse.next();
}
const token = request.cookies.get('next-auth.session-token') ||
request.cookies.get('__Secure-next-auth.session-token');
if (!token && request.nextUrl.pathname !== '/') {
return NextResponse.redirect(new URL('/', request.url));
}
return NextResponse.next();
}
export const config = {
matcher: ['/((?!api/auth|_next/static|_next/image|favicon.ico).*)'],
};