From 6b54bcf5f75060957a32a570766fc40dc254bcd5 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Tue, 20 Jun 2023 23:26:15 +0200 Subject: [PATCH] rename option --- src/utils/session.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/session.ts b/src/utils/session.ts index f0bd82a5..fc59a4f3 100644 --- a/src/utils/session.ts +++ b/src/utils/session.ts @@ -28,7 +28,7 @@ export interface SessionConfig { seal?: SealOptions; crypto?: Crypto; /** Default is Crypto.randomUUID */ - idGenerator?: () => string; + generateId?: () => string; } const DEFAULT_NAME = "h3"; @@ -114,7 +114,7 @@ export async function getSession( // New session store in response cookies if (!session.id) { session.id = - config.idGenerator?.() ?? (config.crypto || crypto).randomUUID(); + config.generateId?.() ?? (config.crypto || crypto).randomUUID(); session.createdAt = Date.now(); await updateSession(event, config); }