From 628ff1eab5cb5996ac52cfb34389eec6aa2fc482 Mon Sep 17 00:00:00 2001 From: decolua Date: Wed, 9 Sep 2026 09:45:23 +0700 Subject: [PATCH] fix(auth): set 24h maxAge for dashboard session cookie Co-Authored-By: Claude Code --- src/lib/auth/dashboardSession.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/auth/dashboardSession.js b/src/lib/auth/dashboardSession.js index b4c65aae..8f81cec5 100644 --- a/src/lib/auth/dashboardSession.js +++ b/src/lib/auth/dashboardSession.js @@ -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, }); }