import { cookies } from "next/headers"; import { isAuthEnabled } from "@/lib/auth/config"; import { getSessionUsername, SESSION_COOKIE } from "@/lib/auth/session"; export async function getHistoryUsername(): Promise { if (!isAuthEnabled()) { return "guest"; } const cookieStore = await cookies(); const token = cookieStore.get(SESSION_COOKIE)?.value; return getSessionUsername(token); }