-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cherry-pick of 'Ensure user is prompted for password during reminder …
…based backup (#22307)' into v11.7.0 During the backup flow, we should prompt a user for a password. This provides extra friction during a security sensitive step. 1. Build, install and onboard 2. Make sure to back up your seed phrase during onboarding. Onboarding should work as normal 3. Once you get to the home screen, replace `home.html` in the url browsers url bar with `home.html#onboarding/secure-your-wallet/?isFromReminder=true` and press enter 4. Click "Secure my wallet" 5. You should then be prompted to enter your password. 6. After entering your password, you should be able to proceed as normal If you repeat those steps but click cancel when being prompted to enter your password, you should be taken to the home screen. If you repeat those steps, but on step 2 don't back up your seed phrase, the remaining steps should work as described above. https://github.com/MetaMask/metamask-extension/assets/7499938/ac8b5dfb-ca7b-4622-95b8-07db5405abfe - [ ] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've clearly explained what problem this PR is solving and how it is solved. - [ ] I've linked related issues - [ ] I've included manual testing steps - [ ] I've included screenshots/recordings if applicable - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. - [ ] I’ve properly set the pull request status: - [ ] In case it's not yet "ready for review", I've set it to "draft". - [ ] In case it's "ready for review", I've changed it from "draft" to "non-draft". - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --------- Co-authored-by: Pedro Figueiredo <[email protected]>
- Loading branch information
1 parent
225a872
commit 1d83e1f
Showing
12 changed files
with
167 additions
and
35 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
.yarn/patches/@metamask-keyring-controller-npm-8.0.3-63afac5958.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff --git a/dist/KeyringController.js b/dist/KeyringController.js | ||
index fc1c30d4e23badb803242eee5cac65ece8de172b..57d0067cbe551fc0cea986daedf95344dd41fa14 100644 | ||
--- a/dist/KeyringController.js | ||
+++ b/dist/KeyringController.js | ||
@@ -645,7 +645,6 @@ class KeyringController extends base_controller_1.BaseControllerV2 { | ||
throw new Error('Seed phrase imported different accounts.'); | ||
} | ||
}); | ||
- return seedWords; | ||
}); | ||
} | ||
// QR Hardware related methods |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from './reveal-SRP-modal'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
import PropTypes from 'prop-types'; | ||
import React, { useCallback, useState } from 'react'; | ||
import { | ||
Display, | ||
TextVariant, | ||
FontWeight, | ||
} from '../../../helpers/constants/design-system'; | ||
import { useI18nContext } from '../../../hooks/useI18nContext'; | ||
import { getSeedPhrase } from '../../../store/actions'; | ||
import { | ||
Box, | ||
Modal, | ||
ModalContent, | ||
ModalHeader, | ||
ModalOverlay, | ||
ButtonPrimary, | ||
ButtonSecondary, | ||
FormTextField, | ||
} from '../../component-library'; | ||
|
||
export default function RevealSRPModal({ | ||
setSecretRecoveryPhrase, | ||
onClose, | ||
isOpen, | ||
}) { | ||
const t = useI18nContext(); | ||
|
||
const [password, setPassword] = useState(''); | ||
|
||
const onSubmit = useCallback( | ||
async (_password) => { | ||
const seedPhrase = await getSeedPhrase(_password); | ||
setSecretRecoveryPhrase(seedPhrase); | ||
}, | ||
[setSecretRecoveryPhrase], | ||
); | ||
|
||
return ( | ||
<Modal isOpen={isOpen} onClose={onClose}> | ||
<ModalOverlay /> | ||
<ModalContent> | ||
<ModalHeader onClose={onClose}>{t('revealSeedWords')}</ModalHeader> | ||
<Box paddingLeft={4} paddingRight={4}> | ||
<form | ||
onSubmit={(e) => { | ||
e.preventDefault(); | ||
onSubmit(password); | ||
}} | ||
> | ||
<FormTextField | ||
marginTop={6} | ||
id="account-details-authenticate" | ||
label={t('enterYourPassword')} | ||
placeholder={t('password')} | ||
onChange={(e) => setPassword(e.target.value)} | ||
value={password} | ||
variant={TextVariant.bodySm} | ||
type="password" | ||
labelProps={{ fontWeight: FontWeight.Medium }} | ||
autoFocus | ||
/> | ||
</form> | ||
<Box display={Display.Flex} marginTop={6} gap={2}> | ||
<ButtonSecondary onClick={onClose} block> | ||
{t('cancel')} | ||
</ButtonSecondary> | ||
<ButtonPrimary | ||
onClick={() => onSubmit(password)} | ||
disabled={password === ''} | ||
block | ||
> | ||
{t('confirm')} | ||
</ButtonPrimary> | ||
</Box> | ||
</Box> | ||
</ModalContent> | ||
</Modal> | ||
); | ||
} | ||
|
||
RevealSRPModal.propTypes = { | ||
/** | ||
* A function to set a secret receovery phrase in the context that is rendering the RevealSRPModal | ||
*/ | ||
setSecretRecoveryPhrase: PropTypes.func.isRequired, | ||
onClose: PropTypes.func.isRequired, | ||
isOpen: PropTypes.bool.isRequired, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters