clear background mnemonic on logout
This commit is contained in:
parent
0096fe95a0
commit
85a29ce3ae
|
@ -136,11 +136,17 @@ export async function storeMnemonicAndSeed(
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
localStorage.removeItem('unlocked');
|
localStorage.removeItem('unlocked');
|
||||||
sessionStorage.removeItem('unlocked');
|
|
||||||
} else {
|
} else {
|
||||||
localStorage.setItem('unlocked', plaintext);
|
localStorage.setItem('unlocked', plaintext);
|
||||||
localStorage.removeItem('locked');
|
localStorage.removeItem('locked');
|
||||||
sessionStorage.removeItem('unlocked');
|
}
|
||||||
|
sessionStorage.removeItem('unlocked');
|
||||||
|
if (isExtension) {
|
||||||
|
chrome.runtime.sendMessage({
|
||||||
|
channel: 'sollet_extension_mnemonic_channel',
|
||||||
|
method: 'set',
|
||||||
|
data: '',
|
||||||
|
});
|
||||||
}
|
}
|
||||||
const importsEncryptionKey = deriveImportsEncryptionKey(seed);
|
const importsEncryptionKey = deriveImportsEncryptionKey(seed);
|
||||||
setUnlockedMnemonicAndSeed(
|
setUnlockedMnemonicAndSeed(
|
||||||
|
@ -217,6 +223,13 @@ function deriveImportsEncryptionKey(seed) {
|
||||||
export function forgetWallet() {
|
export function forgetWallet() {
|
||||||
localStorage.clear();
|
localStorage.clear();
|
||||||
sessionStorage.removeItem('unlocked');
|
sessionStorage.removeItem('unlocked');
|
||||||
|
if (isExtension) {
|
||||||
|
chrome.runtime.sendMessage({
|
||||||
|
channel: 'sollet_extension_mnemonic_channel',
|
||||||
|
method: 'set',
|
||||||
|
data: '',
|
||||||
|
});
|
||||||
|
}
|
||||||
unlockedMnemonicAndSeed = {
|
unlockedMnemonicAndSeed = {
|
||||||
mnemonic: null,
|
mnemonic: null,
|
||||||
seed: null,
|
seed: null,
|
||||||
|
|
Loading…
Reference in New Issue