Store calculation history on server with bazi input and chart snapshots.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+11
-2
@@ -13,7 +13,8 @@ export async function middleware(request: NextRequest) {
|
||||
const { pathname } = request.nextUrl;
|
||||
const needsAuth =
|
||||
PROTECTED_PREFIXES.some((p) => pathname === p || pathname.startsWith(`${p}/`)) ||
|
||||
pathname.startsWith("/api/ai");
|
||||
pathname.startsWith("/api/ai") ||
|
||||
pathname.startsWith("/api/history");
|
||||
|
||||
if (!needsAuth) {
|
||||
return NextResponse.next();
|
||||
@@ -34,5 +35,13 @@ export async function middleware(request: NextRequest) {
|
||||
}
|
||||
|
||||
export const config = {
|
||||
matcher: ["/liuyao/:path*", "/bazi/:path*", "/combined/:path*", "/history/:path*", "/api/ai"],
|
||||
matcher: [
|
||||
"/liuyao/:path*",
|
||||
"/bazi/:path*",
|
||||
"/combined/:path*",
|
||||
"/history/:path*",
|
||||
"/api/ai",
|
||||
"/api/history",
|
||||
"/api/history/:path*",
|
||||
],
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user