web: allow clearing keystore

This commit is contained in:
Abdullah Atta
2024-02-16 17:32:27 +05:00
parent 23702e4d1e
commit 32ba0ac2d9

View File

@@ -355,6 +355,13 @@ class KeyStore extends BaseStore<KeyStore> {
else return JSON.parse(decoder.decode(decryptedBlob)).value as Secrets[T];
};
clear = async () => {
await this.#metadataStore.clear();
await this.#secretStore.clear();
this.#key = undefined;
this.set({ credentials: [], secrets: {}, isLocked: false });
};
private update = async (
query: CredentialQuery,
patch: (c: SerializableCredential) => void