Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions packages/extension/src/ui/onboard/create-wallet/wallet-ready.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,21 @@ import { onMounted } from 'vue';
const onboardStore = useOnboardStore();
const restoreStore = useRestoreStore();

// Overwrite the string with random data before setting empty
const secureClear = (value: string) => {
const array = new Uint8Array(value.length);
crypto.getRandomValues(array);
const random = String.fromCharCode(...array);
value = random;
value = '';
return value;
};
Comment thread
olgakup marked this conversation as resolved.

onMounted(() => {
onboardStore.setPassword('');
onboardStore.setMnemonic('');
restoreStore.setMnemonic('');
restoreStore.setPassword('');
onboardStore.setPassword(secureClear(onboardStore.password));
onboardStore.setMnemonic(secureClear(onboardStore.mnemonic));
restoreStore.setMnemonic(secureClear(onboardStore.mnemonic));
restoreStore.setPassword(secureClear(onboardStore.password));
Comment thread
gamalielhere marked this conversation as resolved.
});

const finishAction = () => {
Expand Down