Skip to content
Open
Show file tree
Hide file tree
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
9 changes: 2 additions & 7 deletions app/components/Views/ResetPassword/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ import Icon, {
import Routes from '../../../constants/navigation/Routes';
import { SecurityOptionToggle } from '../../UI/SecurityOptionToggle';
import NavigationService from '../../../core/NavigationService';
import { RecoveryError as SeedlessOnboardingRecoveryError } from '@metamask/seedless-onboarding-controller';

const createStyles = (colors) =>
StyleSheet.create({
Expand Down Expand Up @@ -837,13 +838,7 @@ class ResetPassword extends PureComponent {
</View>
</View>

{this.state.biometryType && (
<SecurityOptionToggle
title={strings('import_from_seed.unlock_with_face_id')}
value={this.state.biometryChoice}
onOptionUpdated={this.updateBiometryChoice}
/>
)}
{this.renderSwitch()}

<View style={styles.ctaWrapper}>
<Button
Expand Down
20 changes: 20 additions & 0 deletions app/core/Vault.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import Engine from './Engine';
import Logger from '../util/Logger';
import { KeyringTypes } from '@metamask/keyring-controller';
import { withLedgerKeyring } from './Ledger/Ledger';
///: BEGIN:ONLY_INCLUDE_IF(seedless-onboarding)
import ReduxService from './redux';
///: END:ONLY_INCLUDE_IF(seedless-onboarding)

/**
* Restore the given serialized QR keyring.
Expand Down Expand Up @@ -103,6 +106,23 @@ export const recreateVaultWithNewPassword = async (
// Recreate keyring with password given to this method
await KeyringController.createNewVaultAndRestore(newPassword, seedPhrase);

///: BEGIN:ONLY_INCLUDE_IF(seedless-onboarding)
const { SeedlessOnboardingController } = Engine.context;
// TODO: Fix with latest controller isCompleted
if (
ReduxService.store.getState().engine.backgroundState
.SeedlessOnboardingController.vault
) {
try {
await SeedlessOnboardingController.changePassword(newPassword, password);
} catch (error) {
Logger.error(error);
await KeyringController.createNewVaultAndRestore(password, seedPhrase);
throw new Error('Password change failed');
}
}
///: END:ONLY_INCLUDE_IF(seedless-onboarding)

if (serializedQrKeyring !== undefined) {
await restoreQRKeyring(serializedQrKeyring);
}
Expand Down
Loading