diff options
| author | Adam Soltys <[email protected]> | 2026-06-26 11:47:31 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-06-26 11:47:31 -0700 |
| commit | 0ffdac0c461e504ea92afed9a45080819cec43c1 (patch) | |
| tree | 84427fb506e78dc186583a3492926fbe7ef4d530 | |
| parent | 0ab50b87ad837bba19cebe5ef2d0ccdf1156847c (diff) | |
| download | coinosv3-0ffdac0c461e504ea92afed9a45080819cec43c1.tar.gz coinosv3-0ffdac0c461e504ea92afed9a45080819cec43c1.zip | |
Auto log-out also wipes a blank-password (unprotected) vault
A vault saved with no password auto-unlocks on open, which would undo the
sign-out. When a logout timer fires (or a boot is overdue), remove it too —
only a password-protected vault survives.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
| -rw-r--r-- | src/app.js | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -1026,6 +1026,7 @@ function applyBootAutoLogout() { try { sessionStorage.removeItem(ACCOUNTS_KEY); } catch {} try { localStorage.removeItem(WATCH_KEY); } catch {} clearWalletCaches(); + wipeBlankVault(); } // Remove every trace of the open wallet from this device: the session, the @@ -1039,11 +1040,21 @@ function clearWalletCaches() { } catch {} } +// A blank-password vault offers no protection and would auto-unlock on the next +// open, undoing the sign-out — so wipe it too. A password-protected vault stays. +function wipeBlankVault() { + const blob = loadVaultBlob(); + if (!blob) return; + try { decryptVault(blob, ''); } catch { return; } // needs a real password — keep it + try { localStorage.removeItem(VAULT_KEY); } catch {} +} + // Full sign-out after the app's been backgrounded past the limit. function autoLogout() { if (ui.screen !== 'wallet') return; // don't interrupt unlock / claim flows try { localStorage.removeItem(WATCH_KEY); } catch {} clearWalletCaches(); + wipeBlankVault(); lock(); // wipes the session + vault password and shows the unlock / vault screen } |
