diff --git a/app/static/js/vault.js b/app/static/js/vault.js index f791f0e..c791e2d 100644 --- a/app/static/js/vault.js +++ b/app/static/js/vault.js @@ -1494,7 +1494,13 @@ const Vault = (() => { const timer = setTimeout(resolve, 800); window.addEventListener('passkeeper:ext-login', () => { clearTimeout(timer); resolve(); }, { once: true }); }); - if (!sessionStorage.getItem('access_token')) { window.location.href = '/login'; return; } + + // Still no token — try a silent refresh using the persisted refresh_token + // before giving up and redirecting. This handles hard-refresh / new-tab scenarios. + if (!sessionStorage.getItem('access_token')) { + const refreshed = await tryRefreshToken(); + if (!refreshed) { window.location.href = '/login'; return; } + } } // Vault