Skip to content

Commit d0dd153

Browse files
committed
add: update keys correctly after updating the password
1 parent 1736f43 commit d0dd153

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/auth/AuthClient.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,16 @@ export class AuthClient {
391391
encryptedItemKeys
392392
);
393393

394+
if (this.keys) {
395+
this.keys.encryptionPublicKey = this.user.keys.encryptionPublicKey;
396+
this.keys.encryptionSecretKey = this.user.keys.encryptionSecretKey;
397+
}
398+
399+
if (typeof window !== "undefined") {
400+
localStorage.setItem("encKey", this.user.keys.encryptionSecretKey);
401+
localStorage.setItem("encPubKey", this.user.keys.encryptionPublicKey);
402+
}
403+
394404
return {
395405
encryptionPublicKey: this.user.keys.encryptionPublicKey,
396406
encryptionSecretKey: this.user.keys.encryptionSecretKey,

0 commit comments

Comments
 (0)