From 41b86c8251aeada4bf4a1c6560bcb3f228c18a58 Mon Sep 17 00:00:00 2001 From: Riccardo Balbo Date: Wed, 16 Oct 2024 12:51:56 +0200 Subject: [PATCH] unsetLocalKey --- components/use-vault.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/use-vault.js b/components/use-vault.js index 7efe861b..5ba47bcd 100644 --- a/components/use-vault.js +++ b/components/use-vault.js @@ -131,6 +131,12 @@ export function useVaultMigration () { return migrate } +export async function unsetLocalKey (userId) { + const config = await openConfig(userId) + await config.unset('key') + await config.close() +} + /** * A react hook to use the vault for a specific owner entity and key * It will automatically handle the vault lifecycle and value updates