refactor: Replace device security toggle in settings + deprecate remember me + introduce auth capabilities functionality#25994
Conversation
… authentication types
…tor/MCWP-305-consolidate-biometrics-and-passcode
…tor/MCWP-305-consolidate-biometrics-and-passcode
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
…o that its easier to read
| // TODO: Remove this once we have a proper way to handle biometrics | ||
| await StorageWrapper.setItem(PASSCODE_DISABLED, TRUE); | ||
| await StorageWrapper.setItem(BIOMETRY_CHOICE_DISABLED, TRUE); | ||
| await SecureKeychain.setGenericPassword(password, authType); |
There was a problem hiding this comment.
Greatly simplify store password to just pass through auth type
| default: | ||
| await SecureKeychain.setGenericPassword(password, undefined); | ||
| // Keep Redux in sync with keychain so getAuthCapabilities reflects actual access control | ||
| this.updateOsAuthEnabled( |
There was a problem hiding this comment.
this is where osAuthEnabled is updated since it reflects the status of stored password result
| isEnrolledAsync(), | ||
| supportedAuthenticationTypesAsync(), | ||
| getEnrolledLevelAsync(), | ||
| StorageWrapper.getItem(BIOMETRY_CHOICE_DISABLED), |
There was a problem hiding this comment.
Also account for legacy flags in auth capabilities derivation
| authStorageType = AUTHENTICATION_TYPE.PASSWORD; | ||
| } | ||
| // The auth type used for keychain storage | ||
| const authType = getAuthType({ |
There was a problem hiding this comment.
Derive auth type from util
| }); | ||
|
|
||
| // Ex - "Face ID", "Device Passcode", "Password" | ||
| const authLabel = getAuthLabel({ |
There was a problem hiding this comment.
Derive auth label from util
| authStorageType: AUTHENTICATION_TYPE; | ||
| authType: AUTHENTICATION_TYPE; | ||
| /** True when device auth cannot be used until the user changes device settings */ | ||
| deviceAuthRequiresSettings: boolean; |
There was a problem hiding this comment.
Boolean to indicate if we should show a link to open OS settings for enabling device authentication
| const defaultOptions = { | ||
| // Default options used for storing credentials in the keychain | ||
| // Do not re-use for other scopes unless you know what you are doing | ||
| const defaultCredentialsOptions: Keychain.SetOptions = { |
There was a problem hiding this comment.
Removed invalid properties
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Selected Tags Reasoning:
The changes don't directly affect:
Performance Test Selection: |
|



Description
This change replaces the legacy authentication toggles in settings (biometrics, passcode, and remember me) with a consolidated toggle: Device Authentication. With the new implementation, we support three authentication tiers: Remember Me (Legacy), Biometrics, and Passcode/Pin/Pattern (Consolidated into Device Authentication). Since Remember Me is deprecated, users using the feature will initially see a Remember Me toggle (to preserve backwards compatibility). However, once turned off, Remember Me will never be shown again. New users will never see the Remember Me option. We are also supporting backwards compatibility with respect to the other two authentication preferences: biometrics and passcode. The app will continue to respect the option that the user has chosen as long as the auth preference is toggled on.
The toggles and authentication system is also designed to support the transition into a more seamless authentication system: Biometrics first authentication with device passcode fallback. In other words, users will be able to use any biometrics or device passcode to access their wallet. For example, if a user disables biometrics in the OS settings while auth preferences is enabled in the app, the app will automatically fallback to use device passcode as opposed to password. Password is used as a fallback whenever authentication preferences is disabled by a user in the app. This is why the toggle is labeled as Device Authentication, because the device handles which auth tier to use.
Changelog
CHANGELOG entry:
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/MCWP-305
Manual testing steps
Remember Me (new users won't see this option anymore)
Legacy biometrics on iOS (force use biometrics)
Legacy Passcode on iOS (force use passcode)
Device Authentication (Consolidated behavior)
Screenshots/Recordings
Before
After
Turning off Remember Me
turn-off-remember-me.mov
Legacy biometrics
legacy-biometrics.mov
Legacy passcode
legacy-passcode.mov
Device authentication on iOS
device-auth-ios.mov
Device authentication on Android
device-authentication-android.mov
Device authentication on Login screen
device-authentication-login.mov
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Touches login and security-settings authentication flows (capability detection, unlock entry points, and preference updates), so regressions could block sign-in or mis-handle auth state despite solid test updates.
Overview
Consolidates authentication UX around a single “Device Authentication” capability model. The login screen replaces the platform-specific
BiometryButton(and its many icon variants) with a newDeviceAuthenticationButtonthat renders a singleSecurityKeyicon and shows/hides based onuseAuthCapabilitiesand lock state.Refactors Security Settings and Remember Me deprecation flow. The legacy settings sections for biometrics/passcode and the Remember Me toggle are removed and replaced with a new
DeviceSecurityTogglethat derives the target auth type viagetAuthCapabilities, supports a settings CTA when OS auth must be enabled, handles password-required errors viaEnterPasswordSimplecallbacks, and uses optimistic UI state. Disabling Remember Me viaTurnOffRememberMeModalnow always restoresPASSWORDauth and clearsPREVIOUS_AUTH_TYPE_BEFORE_REMEMBER_ME, with modal button styling made configurable viacancelButtonMode.Tests and snapshots are updated accordingly (new toggle/button tests, updated selectors, and improved async/trace handling in login tests).
Written by Cursor Bugbot for commit 9a0dae8. This will update automatically on new commits. Configure here.