Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear password in memory (settings page) #63

Merged
merged 1 commit into from
Jun 26, 2024
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
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
Loading