04/17/2026 fix sidebar Sharing and Emergency Access 401 error issues

This commit is contained in:
2026-04-17 17:45:44 -04:00
parent 86d1b5f898
commit b51468661e
+7 -1
View File
@@ -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