From 82cdb6ffa39e990f0aa509f4a577042b395a91a8 Mon Sep 17 00:00:00 2001 From: nobswebdev Date: Mon, 26 Oct 2026 20:22:47 +0100 Subject: [PATCH] Clear ZK viewer secrets and image blob when leaving the page. --- frontend/src/views/ViewerView.vue | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/frontend/src/views/ViewerView.vue b/frontend/src/views/ViewerView.vue index c60e38e..f46f595 100644 --- a/frontend/src/views/ViewerView.vue +++ b/frontend/src/views/ViewerView.vue @@ -79,6 +79,11 @@ onBeforeMount(async () => { } }); +onBeforeUnmount(() => { + cleanRefs(); + viewStore.clearImage(); +}); + const onUnlockSubmit = async (): Promise => { const payload = zkPayload.value; const key = fragmentKey.value; @@ -104,7 +109,10 @@ const onUnlockSubmit = async (): Promise => { } }; -onBeforeUnmount(() => { - viewStore.clearImage(); -}); +const cleanRefs = (): void => { + zkPayload.value = null; + fragmentKey.value = ''; + password.value = ''; + unlockError.value = ''; +};