Fix database session redirect loop

This commit is contained in:
Zachariah K. Sharma
2026-06-07 19:51:14 -06:00
parent 87cf97af7c
commit 095a3fe879
-15
View File
@@ -1,15 +0,0 @@
import { NextResponse } from "next/server";
import { auth } from "@/lib/auth";
export default auth((req) => {
const isApp = req.nextUrl.pathname.startsWith("/app");
if (isApp && !req.auth) {
const url = new URL("/signin", req.url);
url.searchParams.set("from", req.nextUrl.pathname);
return NextResponse.redirect(url);
}
});
export const config = {
matcher: ["/app/:path*"],
};