From 7b0a213591809c544b9f39029faefd0a61a3ec78 Mon Sep 17 00:00:00 2001 From: MananTank Date: Fri, 25 Apr 2025 19:43:03 +0000 Subject: [PATCH] Nebula: Save auth token for 14d (#6864) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ## PR-Codex overview This PR updates the session cookie expiration time from 3 days to 14 days by introducing a constant `FOURTEEN_DAYS_IN_SECONDS`. This change is reflected in multiple functions related to user login and session management. ### Detailed summary - Added constant `FOURTEEN_DAYS_IN_SECONDS` set to `14 * 24 * 60 * 60`. - Updated `maxAge` for cookies in `doNebulaLogin` to `FOURTEEN_DAYS_IN_SECONDS`. - Updated `maxAge` for cookies in `isNebulaLoggedIn` to `FOURTEEN_DAYS_IN_SECONDS`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` --- .../src/app/nebula-app/login/auth-actions.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/apps/dashboard/src/app/nebula-app/login/auth-actions.ts b/apps/dashboard/src/app/nebula-app/login/auth-actions.ts index 1b4b4938db7..338739cb176 100644 --- a/apps/dashboard/src/app/nebula-app/login/auth-actions.ts +++ b/apps/dashboard/src/app/nebula-app/login/auth-actions.ts @@ -16,6 +16,8 @@ import { NEBULA_COOKIE_PREFIX_TOKEN, } from "../_utils/constants"; +const FOURTEEN_DAYS_IN_SECONDS = 14 * 24 * 60 * 60; + export async function getNebulaLoginPayload( params: GenerateLoginPayloadParams, ): Promise { @@ -131,8 +133,7 @@ export async function doNebulaLogin( httpOnly: true, secure: true, sameSite: "strict", - // 3 days - maxAge: 3 * 24 * 60 * 60, + maxAge: FOURTEEN_DAYS_IN_SECONDS, }, ); @@ -144,8 +145,7 @@ export async function doNebulaLogin( httpOnly: true, secure: true, sameSite: "strict", - // 3 days - maxAge: 3 * 24 * 60 * 60, + maxAge: FOURTEEN_DAYS_IN_SECONDS, }, ); @@ -209,8 +209,7 @@ export async function isNebulaLoggedIn(address: string) { httpOnly: false, secure: true, sameSite: "strict", - // 3 days - maxAge: 3 * 24 * 60 * 60, + maxAge: FOURTEEN_DAYS_IN_SECONDS, }); return true; }