Clear in-memory site approvals on address switch
check / check (push) Has been cancelled

Non-remembered approvals should not survive switching to a different
address and back. Wipe connectedSites when broadcasting
accountsChanged so temporary approvals require re-prompting.
This commit is contained in:
sneak committed 2026-02-26 03:59:21 +07:00
1 parent be347155e8
commit e847f27243
1 file changed
+4
+4
View File
@@ -332,6 +332,10 @@ async function handleRpc(method, params, origin) {
// Broadcast accountsChanged to all tabs, respecting per-address permissions
async function broadcastAccountsChanged() {
// Clear non-remembered approvals on address switch
for (const key of Object.keys(connectedSites)) {
delete connectedSites[key];
}
const s = await getState();
const activeAddress = await getActiveAddress();
const allowed = activeAddress ? s.allowedSites[activeAddress] || [] : [];