Skip to content

Commit

Permalink
Clear password in memory (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
grod220 committed Jun 26, 2024
1 parent 5d126c7 commit 402cd2f
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ export const SettingsPassphrase = () => {
const [enteredIncorrect, setEnteredIncorrect] = useState(false);
const [phrase, setPhrase] = useState<string[]>([]);

const sumbit = (e: React.FormEvent<HTMLFormElement>) => {
const submit = (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();

void (async function () {
if (await isPassword(password)) {
setPassword(''); // Clearing so plaintext password does not hangout in memory
setPhrase(await getSeedPhrase());
} else {
setEnteredIncorrect(true);
Expand All @@ -31,7 +32,7 @@ export const SettingsPassphrase = () => {

return (
<SettingsScreen title='Recovery passphrase' IconComponent={FileTextGradientIcon}>
<form className='flex flex-1 flex-col items-start justify-between' onSubmit={sumbit}>
<form className='flex flex-1 flex-col items-start justify-between' onSubmit={submit}>
<div className='flex flex-col gap-3'>
<p className='text-muted-foreground'>
If you change browser or switch to another computer, you will need this recovery
Expand Down

0 comments on commit 402cd2f

Please sign in to comment.