Skip to content

Commit 7b0a213

Browse files
committed
Nebula: Save auth token for 14d (#6864)
<!-- ## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes" If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000): ## Notes for the reviewer Anything important to call out? Be sure to also clarify these in your comments. ## How to test Unit tests, playground, etc. --> <!-- start pr-codex --> --- ## 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}` <!-- end pr-codex -->
1 parent fee560a commit 7b0a213

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

apps/dashboard/src/app/nebula-app/login/auth-actions.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ import {
1616
NEBULA_COOKIE_PREFIX_TOKEN,
1717
} from "../_utils/constants";
1818

19+
const FOURTEEN_DAYS_IN_SECONDS = 14 * 24 * 60 * 60;
20+
1921
export async function getNebulaLoginPayload(
2022
params: GenerateLoginPayloadParams,
2123
): Promise<LoginPayload> {
@@ -131,8 +133,7 @@ export async function doNebulaLogin(
131133
httpOnly: true,
132134
secure: true,
133135
sameSite: "strict",
134-
// 3 days
135-
maxAge: 3 * 24 * 60 * 60,
136+
maxAge: FOURTEEN_DAYS_IN_SECONDS,
136137
},
137138
);
138139

@@ -144,8 +145,7 @@ export async function doNebulaLogin(
144145
httpOnly: true,
145146
secure: true,
146147
sameSite: "strict",
147-
// 3 days
148-
maxAge: 3 * 24 * 60 * 60,
148+
maxAge: FOURTEEN_DAYS_IN_SECONDS,
149149
},
150150
);
151151

@@ -209,8 +209,7 @@ export async function isNebulaLoggedIn(address: string) {
209209
httpOnly: false,
210210
secure: true,
211211
sameSite: "strict",
212-
// 3 days
213-
maxAge: 3 * 24 * 60 * 60,
212+
maxAge: FOURTEEN_DAYS_IN_SECONDS,
214213
});
215214
return true;
216215
}

0 commit comments

Comments
 (0)