Clear in-memory site approvals on address switch
Some checks failed
check / check (push) Has been cancelled
Some checks failed
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:
@@ -332,6 +332,10 @@ async function handleRpc(method, params, origin) {
|
|||||||
|
|
||||||
// Broadcast accountsChanged to all tabs, respecting per-address permissions
|
// Broadcast accountsChanged to all tabs, respecting per-address permissions
|
||||||
async function broadcastAccountsChanged() {
|
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 s = await getState();
|
||||||
const activeAddress = await getActiveAddress();
|
const activeAddress = await getActiveAddress();
|
||||||
const allowed = activeAddress ? s.allowedSites[activeAddress] || [] : [];
|
const allowed = activeAddress ? s.allowedSites[activeAddress] || [] : [];
|
||||||
|
|||||||
Reference in New Issue
Block a user