From 781bdef06d8f21ad2dfd845b2e3969c34cc0e67f Mon Sep 17 00:00:00 2001 From: nmemmert <67961292+nmemmert@users.noreply.github.com> Date: Thu, 29 Oct 2026 11:37:24 -0400 Subject: [PATCH] Passwords: stay unlocked when you leave the tab and come back (bw status needs the session key) Co-Authored-By: Claude Sonnet 5.5 --- pwvault.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pwvault.js b/pwvault.js index a654345..a9a198a 100644 --- a/pwvault.js +++ b/pwvault.js @@ -93,8 +93,9 @@ async function createSend(uid, b, key) { } async function status(uid) { - let st = { status: 'unauthenticated' }; try { st = parse(await bw(uid, ['status'], { timeout: 15e3 })); } catch {} - const s = sessions.get(uid); + const s = sessions.get(uid); // (bw only reports "unlocked" when it is handed the session key) + let st = { status: 'unauthenticated' }; try { st = parse(await bw(uid, ['status'], { session: s && s.key, timeout: 15e3 })); } catch {} + if (s && st.status === 'unlocked') s.last = Date.now(); // coming back to the tab counts as using the vault return { enabled: true, url: URL_, unlocked: !!s && st.status === 'unlocked', email: st.userEmail || '', loggedIn: st.status !== 'unauthenticated' }; }