Use encyption key for Rust Crypto indexed DB

This commit is contained in:
N-Pex 2025-05-16 10:19:46 +02:00
parent aa1ce4ee48
commit 5f6132d745

View file

@ -318,10 +318,13 @@ export default {
cryptoStore: cryptoStore cryptoStore: cryptoStore
//useAuthorizationHeader: true //useAuthorizationHeader: true
}; };
const cryptoStorePassword = this.$config.appName + ":" + user.device_id;
const matrixClient = sdk.createClient(opts); const matrixClient = sdk.createClient(opts);
this.matrixClient = matrixClient; this.matrixClient = matrixClient;
await this.matrixClient.initRustCrypto({useIndexedDB: this.rememberMe});// storageKey: cryptoStorageKey}); await this.matrixClient.initRustCrypto({useIndexedDB: this.rememberMe, storagePassword: cryptoStorePassword});
console.log("Crypto initialized"); console.log("Crypto initialized", cryptoStorePassword);
this.addMatrixClientListeners(this.matrixClient); this.addMatrixClientListeners(this.matrixClient);
this.matrixClient.startClient(); this.matrixClient.startClient();
if (!this.matrixClient.isInitialSyncComplete()) { if (!this.matrixClient.isInitialSyncComplete()) {