Repository navigation
[Payment due @huult] feat(wallet): prompt for magic code when changing wallet phone - #95566
Conversation
# Conflicts: # src/pages/EnablePayments/Pay/AdditionalDetails/AdditionalDetailsStep.tsx # src/pages/EnablePayments/Wallet/PersonalInfo/PersonalInfo.tsx
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: deacc13204
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@dukenv0307 took a look at your screen recording, and it doesn't appear to show us asking for the magic code at all. Am I missing something? |
|
@jasperhuangg My bad, I uploaded the wrong video. But I need to confirm 1 thing first:
Should we show the prompt? |
Yeah let's just always show the prompt, simpler logic. I imagine users will attempt to do that very rarely. |
huult
left a comment
There was a problem hiding this comment.
LGTM.
Note: My native app build failed this time. I’ll update you once it’s done.
@rafecolton all yours |
|
🎯 @huult, thanks for reviewing and testing this PR! 🎉 A payment issue will be created for your review once this PR is deployed to production. If payment is not needed (e.g., regression PR review fix etc), react with 👎 to this comment to prevent the payment issue from being created. |
|
cc @rafecolton |
rafecolton
left a comment
There was a problem hiding this comment.
We should require a magic code any time a phone number is set, including if it was previously blank, not just if it is changed. Else you have this edge case:
- Admin issues a virtual card to a new user who has never set a phone number
- That user grants a bad actor access to their account (i.e. through social engineering) before the user ever viewed the virtual card details, so no phone number was set.
- Bad actor sets phone number for the first time through the wallet flow - no magic code.
- Bad actor gets the user to give them another code, this time to view the card details.
|
I fixed @rafecolton Screen.Recording.2026-07-29.at.12.25.35.PM.mov |
|
Merging since Jasper previously approved and subsequent changes were minor |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 rafecolton has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
Hi @dukenv0307 Seems internal PR. Could you please check? thank you
|
|
🚀 Deployed to staging by https://github.com/rafecolton in version: 9.4.47-0 🚀
|
Help site review — changes required ✅This PR adds a magic code verification prompt to the wallet KYC (Enable payments) flow: when a user changes their phone number to one that differs from the one already saved, they must now confirm the change with a magic code before the personal details are submitted. No code is required when adding a phone number for the first time or leaving it unchanged. This behavior happens during the Enter Personal Information step, which is documented in Set Up Your Wallet, so a doc update is warranted to reflect the new prompt. Draft help site PR: #97545 — adds a note under Enter Personal Information describing the magic code verification (prompt titled Let's make sure it's you). The other files in this PR (route/screen/navigation wiring, API param, shared components, tests) are internal implementation details with no user-facing surface beyond the prompt already covered above. @dukenv0307, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR |
|
🚀 Deployed to production by https://github.com/marcaaron in version: 9.4.47-7 🚀
Bundle Size Analysis (Sentry): |
|
🤖 Payment issue created: #97615 |
| // code, SSN, or a generic failure) keeps the screen open to retry. | ||
| if (wasLoading.current && !hasErrors) { | ||
| wasLoading.current = false; | ||
| Navigation.navigate(ROUTES.SETTINGS_ENABLE_PAYMENTS.getRoute({page: CONST.ENABLE_PAYMENTS.PAGE_NAMES.VERIFY_IDENTITY})); |
There was a problem hiding this comment.
Coming from #102336, navigation here always opens the Settings wallet identity page after the magic code is accepted. useWalletPhoneMagicCode is shared with the IOU pay flow (Pay/AdditionalDetails/AdditionalDetailsStep.tsx), so paying an IOU with a personal bank account lands here too.
The pay-flow page stays mounted underneath and also advances to Onfido from userWallet.currentStep. This page then mounts a second Onfido into the same #onfido-mount container. The SDK renders into the hidden screen, and the visible one stays blank.
Explanation of Change
In the wallet KYC personal-details step, when the user changes an existing phone number we now prompt for a magic code before submitting, and pass it as
validateCodetoUpdatePersonalDetailsForWallet. This protects the phone number used for card 3DS verification. If the code is missing or wrong, the backend returns anincorrectMagicCodeerror and the prompt stays open with the error shown; if the phone number is unchanged (or being set for the first time), no code is required.Both wallet KYC flows that call
UpdatePersonalDetailsForWalletare covered: the current Settings → Wallet flow (Wallet/PersonalInfo/PersonalInfo.tsx, prompt shown after the Confirmation substep) and the older IOU send-money flow (Pay/AdditionalDetails/AdditionalDetailsStep.tsx).Related PRs (must deploy together): Auth https://github.com/Expensify/Auth/pull/22768 · Web-Expensify https://github.com/Expensify/Web-Expensify/pull/54357
Fixed Issues
$
For https://github.com/Expensify/Expensify/issues/623849
PROPOSAL: N/A (internal, backend-driven security fix)
Tests
Precondition:
Run https://github.com/Expensify/Auth/pull/22768 locally (build + restart)
Local dev setup notes:
Manual:
The dev magic code is always 000000 (hardcoded off-live).
To pass wallet KYC without hitting IDology, use the test identity: Alberta Bobbeth Charleson, DOB 2000-08-08, SSN 123456789 (linked test bank: routing 011401533, checking 1111222233330000).
Offline tests
QA Steps
Assign to @dukenv0307, will test once Auth and App PRs are deployed
IMPORTANT: QA please be advised, it is expected that incorrect magic codes will be accepted in this flow until the BE changes are deployed.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)Avatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2026-07-16.at.3.50.24.PM.mov
Screen.Recording.2026-07-16.at.3.50.53.PM.mov
Screen.Recording.2026-07-16.at.4.00.36.PM.mov