add descriptive error message for work email already associated with 2FA account#88287
Conversation
b425d5d to
d89d54e
Compare
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4951e322fe
ℹ️ 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".
|
Aren't we missing screenshots for the other platforms? Then this is more of an internal comment, though I think we can really tighten up the error message, as it's hard to understand. I recommend: "This login is an existing account with Two-Factor Authentication (2FA) enabled." The offline error message looks fine. |
|
Thanks @JmillsExpensify for review, yes I am currently trying to test on all platforms, that's why screenshots are missing. |
|
@mnshrm yeah, let's update the error message as suggested and let me know once you tested all platforms, thanks! |
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running: npx ts-node ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
|
@grgia, fixed lint errors |
|
@mnshrm Please have a look at the conflicts, thx! |
|
There are some errors in jobs, fixing them. |
|
Fixed errors |
|
🚧 @grgia has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/grgia in version: 9.3.80-0 🚀
Bundle Size Analysis (Sentry): |
|
No help site changes are required for this PR. This PR adds an inline error message during the onboarding work email step when a user enters an email already associated with a 2FA-enabled account. It's a UI error handling improvement (descriptive inline error instead of a generic blocking screen) — no new feature, workflow, or setting was introduced. The existing help site articles covering Two-Factor Authentication, Login Troubleshooting, and Join Your Company's Workspace don't document specific onboarding error messages, so no updates are needed. |
|
This PR failing because of the issue #91566 |
|
@jponikarchuk, Allow me to investigate this issue and provide an update in 91566 Thanks |
|
@jponikarchuk, Here are my findings, I think bug logged is not correct.
which is different from what is expected, According to logic written, 2FA error is only rendered when above mentioned error message is returned in response, otherwise generic message is surfaced. |
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.3.81-2 🚀
|

Explanation of Change
This MR resolves error reporting in case '2FA account error' that occurs when user tries to add a work email which is already associated with an account with 2FA enabled.
MR adds new onyx key onboardingErrorMessage, uses makeRequestWithSideEffect so that key is updated, then with the use of useEffect hook, uses newly created actions addWorkEmailFormError, clearWorkEmailFormError, to update the form errors, this allows rendering of 2FA error on screen as an inline error. Next, as soon as user tries to correct his/her form errors are cleared when form input value changes.
Fixed Issues
$ #86194
PROPOSAL: $ #86194 (comment)
Tests
PRE-REQUISITE: A account with work email and 2FA enabled.
Scenario : 2FA error is displayed when user attempts to enter a work email already associated to a account with 2FA enabled
Scenario: 2FA error is not visible when user modifies input value of work email form.
Scenario: User is able to add work email if he/she enters a work email without any associated account.
We do get following error in console.
This error also appears in main branch as well, so it is not due to our code changes.
Offline tests
PRE-REQUISITE: A account with work email and 2FA enabled.
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, 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.ScrollViewcomponent to make it scrollable when more elements are added to the page.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
Windows: Chrome