Skip to content

Commit 0712bff

Browse files
committed
fix: update session on commit
1 parent 898d8a6 commit 0712bff

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/mpcCoreKit.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -897,6 +897,19 @@ export class Web3AuthMPCCoreKit implements ICoreKit {
897897
// manual call syncLocalMetadataTransitions() required to sync local transitions to storage
898898
await this.tKey._syncShareMetadata();
899899
await this.tKey.syncLocalMetadataTransitions();
900+
901+
if (this.sessionId) {
902+
const payload: SessionData = {
903+
postBoxKey: this.state.postBoxKey,
904+
postboxKeyNodeIndexes: this.state.postboxKeyNodeIndexes || [],
905+
factorKey: this.state.factorKey?.toString("hex"),
906+
tssShareIndex: this.state.tssShareIndex as number,
907+
tssPubKey: this.state.tssPubKey?.toString("hex"),
908+
signatures: this.signatures,
909+
userInfo: this.state.userInfo,
910+
};
911+
this.sessionManager.updateSession(payload);
912+
}
900913
} catch (error: unknown) {
901914
log.error("sync metadata error", error);
902915
throw error;
@@ -1214,7 +1227,7 @@ export class Web3AuthMPCCoreKit implements ICoreKit {
12141227
}
12151228
}
12161229
} catch (err) {
1217-
log.warn("failed to authorize session", err);
1230+
log.warn("failed to authorize session please use new", err);
12181231
}
12191232
}
12201233

0 commit comments

Comments
 (0)