fix(auth): set 24h maxAge for dashboard session cookie

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
decolua
2026-09-09 09:45:23 +07:00
parent e7b5f09d50
commit 628ff1eab5

View File

@@ -7,6 +7,7 @@ import { DATA_DIR } from "@/lib/dataDir";
import { getSettings } from "@/lib/localDb";
const DEFAULT_PASSWORD = "123456";
const SESSION_MAX_AGE_SEC = 24 * 60 * 60;
function loadJwtSecret() {
if (process.env.JWT_SECRET) return process.env.JWT_SECRET;
@@ -64,6 +65,7 @@ export async function setDashboardAuthCookie(cookieStore, request, claims = {})
secure: shouldUseSecureCookie(request),
sameSite: "lax",
path: "/",
maxAge: SESSION_MAX_AGE_SEC,
});
}