mirror of
https://github.com/jakejarvis/sofa.git
synced 2026-08-29 03:55:38 -04:00
17 lines
452 B
TypeScript
17 lines
452 B
TypeScript
import { getSessionCookie } from "better-auth/cookies";
|
|
import { type NextRequest, NextResponse } from "next/server";
|
|
|
|
export function proxy(request: NextRequest) {
|
|
const sessionCookie = getSessionCookie(request);
|
|
|
|
if (!sessionCookie) {
|
|
return NextResponse.redirect(new URL("/login", request.url));
|
|
}
|
|
|
|
return NextResponse.next();
|
|
}
|
|
|
|
export const config = {
|
|
matcher: ["/dashboard", "/explore", "/settings", "/setup", "/titles/:path*"],
|
|
};
|