Skip to content

Commit 82de5d4

Browse files
fix session manager usage check
1 parent ed1394f commit 82de5d4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/mpcCoreKit.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,14 +1138,14 @@ export class Web3AuthMPCCoreKit implements ICoreKit {
11381138
}
11391139

11401140
private async createSession() {
1141-
if (!this.sessionManager) {
1141+
if (!this.options.disableSessionManager && !this.sessionManager) {
11421142
throw new Error("sessionManager is not available");
11431143
}
11441144

11451145
try {
11461146
const sessionId = SessionManager.generateRandomSessionKey();
11471147
this.sessionManager.sessionId = sessionId;
1148-
const { postBoxKey, factorKey, userInfo, tssShareIndex, tssPubKey } = this.state;
1148+
const { postBoxKey, factorKey, userInfo, tssShareIndex, tssPubKey, postboxKeyNodeIndexes } = this.state;
11491149
if (!this.state.factorKey) {
11501150
throw CoreKitError.factorKeyNotPresent("factorKey not present in state when creating session.");
11511151
}
@@ -1157,6 +1157,7 @@ export class Web3AuthMPCCoreKit implements ICoreKit {
11571157
}
11581158
const payload: SessionData = {
11591159
postBoxKey,
1160+
postboxKeyNodeIndexes: postboxKeyNodeIndexes || [],
11601161
factorKey: factorKey?.toString("hex"),
11611162
tssShareIndex: tssShareIndex as number,
11621163
tssPubKey: Buffer.from(tssPubKey).toString("hex"),

0 commit comments

Comments
 (0)