Skip to content

Commit 0d61d3d

Browse files
committed
we must use session.id not sessionId
1 parent 1405eb8 commit 0d61d3d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/common/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export interface ImpersonateReturnType {
4949
}
5050

5151
export interface SessionType {
52-
sessionId: string;
52+
id: string;
5353
userId: string;
5454
token: string;
5555
valid: boolean;

packages/server/src/accounts-server.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -347,10 +347,10 @@ export class AccountsServer {
347347
throw new AccountsError('User not found', { id: session.userId });
348348
}
349349
const tokens = this.createTokens(sessionToken);
350-
await this.db.updateSession(session.sessionId, { ip, userAgent });
350+
await this.db.updateSession(session.id, { ip, userAgent });
351351

352352
const result = {
353-
sessionId: session.sessionId,
353+
sessionId: session.id,
354354
user: this.sanitizeUser(user),
355355
tokens,
356356
};
@@ -415,7 +415,7 @@ export class AccountsServer {
415415
throw new AccountsError('User not found', { id: session.userId });
416416
}
417417

418-
await this.db.invalidateSession(session.sessionId);
418+
await this.db.invalidateSession(session.id);
419419
this.hooks.emit(
420420
ServerHooks.LogoutSuccess,
421421
this.sanitizeUser(user),

0 commit comments

Comments
 (0)