chore: Replace userEntryAuth and appTriggeredAuth with unlockWallet on Login screen#24496
chore: Replace userEntryAuth and appTriggeredAuth with unlockWallet on Login screen#24496
Login screen#24496Conversation
…/6008-abstract-auth-api-cal
…rors are encountered
…tor/MCWP-240-login-screen
NicolasMassart
left a comment
There was a problem hiding this comment.
Looks good to me.
…tor/MCWP-240-login-screen
| @@ -398,77 +360,54 @@ const Login: React.FC<LoginProps> = ({ saveOnboardingEvent }) => { | |||
| op: TraceOperation.Login, | |||
| }, | |||
| async () => { | |||
There was a problem hiding this comment.
would it be better if we check for the Authentication.checkIsSeedlessPasswordOutdated
before the unlockWallet?
We could prompt user that global password changed and navigate user to rehydration screen if checkIsSeedlessPasswordOutdated is TRUE
In this case, handleLoginError do not need to handle any SeedlessOnboardingError
There was a problem hiding this comment.
We discussed this topic a week or two ago and landed on designing it this way, which provided a few benefits:
- Allows us to abstract seedless onboarding checks only when needed, cleaning up component life cycles that check for seedless onboarding outdated check
- Assuming a user enters the correct global password, it doesn't look like they would need to be routed to the rehydration screen since the sync happens automatically in the background?
- The seedless check needs to happen in a few places and the areas are identified as the same places where unlock happens, so it made sense to abstract it there
…tor/MCWP-240-login-screen
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsThis PR makes significant changes to the core Authentication service and Login flow, which are critical components used by virtually all E2E tests:
The Given the critical nature of these changes affecting the authentication flow that gates access to all wallet functionality, running all test tags is the safest approach to ensure no regressions are introduced. |
|



Description
This change refactors the
Loginscreen to replace bothuserEntryAuthandappTriggeredAuthwith the consolidated method,unlockWallet.unlockWalletprovides us with benefits, which includes automatically handling manual/biometrics password, outdated seedless password check, and intelligently navigates to onboarding or login based on the existence of a user. In follow up PRs, we will continue to surgically useunlockWalletto further consolidate logic associated with unlocking the wallet. There were also a couple of UI bug fixes related to the Login page. These issues included, persisting biometrics icon on password submission and preventing input and biometrics button interaction while loading. Lastly, we removed a redundant biometrics prompt when FIRST enabling biometrics toggle upon logging in. It is not needed since the password is already provided.Previous PR that created the
unlockWalletmethod - #23958Changelog
CHANGELOG entry:
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/MCWP-240
Manual testing steps
Using biometrics
Using manual password entry
Screenshots/Recordings
Before
After
Authenticating using manual password entry and biometrics
https://github.com/user-attachments/assets/b5a71cea-e386-4af2-8e15-f3c5c1c3096f
Navigates to opt in metrics screen when needed
https://github.com/user-attachments/assets/9269b1f1-d10b-435f-a267-d5eb328d9ace
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Refactor: Centralize authentication via
unlockWalletuserEntryAuth/appTriggeredAuthwithunlockWalletinLogin, using newuseAuthenticationhook (getAuthType,componentAuthenticationType)OPTIN_METRICS) and error handling intoAuthentication.unlockWallet; add lock-on-error behaviorcontainsErrorMessageand normalize constants (removeError:prefixes)LoginUX: disable input/biometry while loading, clear/blur input on submit, handle biometric/passcode states, show alerts for passcode unset, route toREHYDRATEfor outdated seedless passwordsSecureKeychain: remove storage side-effects and iOS immediate prompt logic; storage flag updates handled inAuthentication.updateAuthPreferenceBiometryButtonnow extendsTouchableOpacityPropsand spreads propsONBOARDING.REHYDRATE; remove unused storage keysWritten by Cursor Bugbot for commit 8789032. This will update automatically on new commits. Configure here.