Skip to content

Commit

Permalink
rename option
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Jun 20, 2023
1 parent 9fcc3e5 commit 6b54bcf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export interface SessionConfig {
seal?: SealOptions;
crypto?: Crypto;
/** Default is Crypto.randomUUID */
idGenerator?: () => string;
generateId?: () => string;
}

const DEFAULT_NAME = "h3";
Expand Down Expand Up @@ -114,7 +114,7 @@ export async function getSession<T extends SessionDataT = SessionDataT>(
// 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);
}
Expand Down

0 comments on commit 6b54bcf

Please sign in to comment.