Store calculation history on server with bazi input and chart snapshots.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-13 09:57:16 +08:00
parent fcf071cfaa
commit 123a5cce6d
17 changed files with 419 additions and 54 deletions
+12
View File
@@ -0,0 +1,12 @@
import { cookies } from "next/headers";
import { isAuthEnabled } from "@/lib/auth/config";
import { getSessionUsername, SESSION_COOKIE } from "@/lib/auth/session";
export async function getHistoryUsername(): Promise<string | null> {
if (!isAuthEnabled()) {
return "guest";
}
const cookieStore = await cookies();
const token = cookieStore.get(SESSION_COOKIE)?.value;
return getSessionUsername(token);
}