You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2026-11-10] [$175] 2FA - After setup 2FA new workspace user is stay in Account option #101848
Version Number: 9.4.91-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:https://test-management.browserstack.com/projects/2219752/folder/13176909/test-cases/41237458 Email or phone of affected tester (no customers):utester29+4_270@gmail.com Issue reported by: Applause Internal Team Bug source: Regression TC Execution Device used: Windows 11/ Chrome and Android 12 Chrome App Component: Workspace Settings
Action Performed:
Precondition:
User A have Xero connection established in the workspace.
Steps:
Login to staging.new.expensify.com
Navigate to workspace settings (User A) where Xero is connected
changed the title [-][26W38] - [2FA] - After setup 2FA new workspace user is stay in Account option[/-][+]2FA - After setup 2FA new workspace user is stay in Account option[/+]on Sep 22, 2026
Updated 2026-09-28: Revised based on feedback from Krishna2323.
Proposal
What is the root cause of that problem?
The required-2FA overlay starts 2FA setup with Settings > Security as the base route. When the user presses Got it, the success page can't tell a forced entry from a voluntary one.
Forced 2FA during onboarding: dismiss to Home and resume onboarding.
Settings > Security base: stay in the RHP on the "2FA enabled" page.
Anything else: goBack() to the base route.
An invited admin who has already finished onboarding fails branch 1, because isForced2FAOnboardingSetup requires incomplete onboarding. Branch 2 then wins because the overlay passed ROUTES.SETTINGS_SECURITY (RequireTwoFactorAuthenticationOverlay.tsx:93-96). The admin is left on Account > Security, which is the reported Actual Result.
What changes do you think we should make in order to solve the problem?
Use the base route as the forced-entry signal.
In RequireTwoFactorAuthenticationOverlay, pass ROUTES.HOME as the base route instead of ROUTES.SETTINGS_SECURITY. The overlay is the only caller that uses a Home base. Settings > Security, the USD bank account flow, and the Xero flow all use their own active route.
In DynamicSuccessPage, add isRequired2FAOverlayFlow = focusedRoute?.name === SCREENS.HOME. Gate the onboarding handoff on (isSecuritySettingsFlow || isRequired2FAOverlayFlow) && isForcedOnboardingHandoff. Update the comment above it, which says forced setup always enters from Security.
Forced entry, onboarding complete: falls through to goBack(), which calls quitAndNavigateBack('home') and lands on Home.
Forced entry, onboarding incomplete: runs the existing handoff, which calls openApp() and resumes onboarding at the saved step.
Voluntary Settings > Security entry: stays on the Enabled page.
USD bank account and Xero flows: unchanged. Their base is neither Home nor Security, so they never enter the onboarding handoff.
What specific scenarios should we cover in automated tests?
Add tests/unit/pages/settings/Security/TwoFactorAuth/DynamicSuccessPageTest.tsx. Mock SuccessPageBase to capture onButtonPress, mock useDynamicBackPath, and mock Navigation. No test covers this page today.
Forced entry + onboarding complete: base home, hasCompletedGuidedSetupFlow: true. Expect goBack('home'), and expect no call to navigate(SETTINGS_2FA_ENABLED) or resumeOnboardingAfterRequired2FASetup.
Forced entry + onboarding incomplete: base home, twoFactorAuthSetupInProgress: true, hasCompletedGuidedSetupFlow: false. Expect revealRouteBeforeDismissingModal(ROUTES.HOME) followed by resumeOnboardingAfterRequired2FASetup.
Voluntary Settings > Security entry: base settings/security, onboarding complete. Expect navigate(ROUTES.SETTINGS_2FA_ENABLED, {forceReplace: true}) and clearTwoFactorAuthData(true).
What alternative solutions did you explore? (Optional)
Alternatives considered
New Onyx flag (isForcedTwoFactorAuthSetup). Rejected: it adds global state that must be cleared by hand. The base route already carries the signal.
Drop the base-route check and gate the handoff on isForcedOnboardingHandoff alone. Rejected: USD bank account and Xero 2FA setups by users with incomplete onboarding would be pulled into the onboarding handoff.
Read account.needsTwoFactorAuthSetup at Got it time. Rejected: the openApp response after enabling 2FA overwrites it, so the check is racy.
Risk review
Required 2FA setup screen is unresponsive, blocking new-domain login and account merge doesn't depend on the Security base. Before that PR, the overlay passed no base, so the route was built on the onboarding screen behind the overlay. The linked issue picked Security only as a "stable, always-resolvable base". Home was never compared. The onboarding guard's 2FA exception checks account state and the focused 2FA screen name, not the base route (OnboardingGuard.ts:125-130). So the Enable button still opens the wizard with a Home base.
Only DynamicSuccessPage reads the base. That dependency is real: validateTwoFactorAuth defers openApp() until the handoff on Got it (Session/index.ts:1487-1514). Step 2 keeps that handoff running for the Home base.
Small edge case:useDynamicBackPath returns ROUTES.HOME if the navigation state isn't ready (useDynamicBackPath.ts:33-35). The success page mounts only after navigation is ready, so the risk is low.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/101848#issuecomment-5771800818) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
Please re-state the problem that we are trying to solve in this issue.
When an invited admin logs in to an account where a workspace requires 2FA (e.g. Xero connected), the "2FA is required" overlay blocks the screen. After clicking "Enable", validating the account, and completing the 2FA flow, clicking the "Got it" button leaves the user stuck on the Account / Security settings page instead of redirecting them to the Home tab / Workspace.
What is the root cause of that problem?
In RequireTwoFactorAuthenticationOverlay.tsx:93-96, the overlay's "Enable" button explicitly hardcodes ROUTES.SETTINGS_SECURITY as the base path:
This creates dynamic 2FA setup routes with backTo = ROUTES.SETTINGS_SECURITY.
When 2FA setup completes and the user reaches DynamicSuccessPage.tsx:
useDynamicBackPath resolves to settings/security, making focusedRoute?.name === SCREENS.SETTINGS.SECURITY (isSecuritySettingsFlow = true).
For an existing user who has already completed guided setup (or whose onboarding is complete), hasCompletedGuidedSetupFlow is true, so isForcedOnboardingHandoff evaluates to false.
The app assumes the user entered voluntarily from Settings > Security to view their security settings, and keeps the modal open on SETTINGS_2FA_ENABLED over Account > Security. Because the overlay forced the entry using ROUTES.SETTINGS_SECURITY, the app cannot differentiate a forced 2FA entry from an intentional voluntary visit to Security Settings.
What changes do you think we should make in order to solve the problem?
1. Pass ROUTES.HOME as the base route in RequireTwoFactorAuthenticationOverlay.tsx
The required 2FA overlay intercepts the user on Home / Workspace, not inside Security Settings. The base return destination for the forced flow should be ROUTES.HOME:
2. Ensure onboarding handoff in DynamicSuccessPage.tsx handles both base routes
In DynamicSuccessPage.tsx:
Update the check for forced onboarding handoff so that users who still need to complete onboarding resume onboarding whether the route originated from HOME or SETTINGS_SECURITY:
If the user entered via the required overlay (dynamicBackPath === ROUTES.HOME), goBack() executes quitAndNavigateBack(dynamicBackPath), cleanly dismissing the modal and landing the user on the Home tab.
What specific scenarios should be covered in tests?
Add unit tests in tests/unit/TwoFactorAuthFlowTest.ts:
Forced 2FA overlay entry (onboarding complete):
User triggers 2FA from RequireTwoFactorAuthenticationOverlay.
Complete 2FA and press "Got it".
Assert Navigation.navigate / quitAndNavigateBack redirects to ROUTES.HOME, NOT SETTINGS_2FA_ENABLED.
Voluntary 2FA entry from Security Settings:
User navigates to Settings > Security > Two-Factor Authentication.
Complete 2FA and press "Got it".
Assert user remains in RHP on SETTINGS_2FA_ENABLED.
Forced 2FA overlay entry (onboarding incomplete):
User with incomplete guided setup completes 2FA from overlay.
Assert completeForcedOnboarding2FAHandoff fires and resumes onboarding.
What alternative solutions did you explore? (Optional)
Setting a persistent Onyx flag (e.g. isForcedTwoFactorAuthSetup):
Adds state to the global store that must be manually cleared. Pointing the overlay's dynamic route directly to ROUTES.HOME is stateless, self-cleaning, and uses the existing dynamicBackPath routing architecture.
@MelvinBot, your root cause looks right to me, but I'd rather not add a new Onyx flag. The base route can already tell the forced entry apart. Please look into this approach instead:
In RequireTwoFactorAuthenticationOverlay.tsx, pass ROUTES.HOME as the base route instead of ROUTES.SETTINGS_SECURITY.
In DynamicSuccessPage.tsx, add isRequired2FAOverlayFlow = focusedRoute?.name === SCREENS.HOME and gate the handoff on (isSecuritySettingsFlow || isRequired2FAOverlayFlow) && isForcedOnboardingHandoff.
Onboarded admins should then fall through to goBack() and land on Home, while the voluntary Settings > Security flow keeps its stay-in-RHP behavior from #92637. Please don't drop the base-route check entirely, since that would pull the USD bank account and Xero 2FA flows into the onboarding handoff for users who haven't finished onboarding.
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Regression Test Proposal
Precondition:
Account A owns a workspace with Xero connected.
Account B has finished onboarding and has 2FA disabled.
Test:
As Account A, go to the workspace Members page and invite Account B as an Admin.
Log in as Account B.
On the Two-factor authentication required screen, click Enable.
Complete the 2FA setup (validate the account if asked, copy the codes, enter the 6-digit code).
On the Two-factor authentication enabled page, click Got it.
Verify that the 2FA modal closes and the user lands on Home, not on Account > Security.
Activity
applause-bot commentedon Sep 22, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/29f354f2d0d3a9c452a85bf55ddbe3a4216f249e7c98c15e1add8eab2d696195
[-][26W38] - [2FA] - After setup 2FA new workspace user is stay in Account option[/-][+]2FA - After setup 2FA new workspace user is stay in Account option[/+]MelvinBot commentedon Sep 22, 2026
Updated 2026-09-28: Revised based on feedback from
Krishna2323.Proposal
What is the root cause of that problem?
The required-2FA overlay starts 2FA setup with Settings > Security as the base route. When the user presses Got it, the success page can't tell a forced entry from a voluntary one.
In
DynamicSuccessPage.tsx:96-116, Got it has three outcomes:goBack()to the base route.An invited admin who has already finished onboarding fails branch 1, because
isForced2FAOnboardingSetuprequires incomplete onboarding. Branch 2 then wins because the overlay passedROUTES.SETTINGS_SECURITY(RequireTwoFactorAuthenticationOverlay.tsx:93-96). The admin is left on Account > Security, which is the reported Actual Result.What changes do you think we should make in order to solve the problem?
Use the base route as the forced-entry signal.
RequireTwoFactorAuthenticationOverlay, passROUTES.HOMEas the base route instead ofROUTES.SETTINGS_SECURITY. The overlay is the only caller that uses a Home base. Settings > Security, the USD bank account flow, and the Xero flow all use their own active route.DynamicSuccessPage, addisRequired2FAOverlayFlow = focusedRoute?.name === SCREENS.HOME. Gate the onboarding handoff on(isSecuritySettingsFlow || isRequired2FAOverlayFlow) && isForcedOnboardingHandoff. Update the comment above it, which says forced setup always enters from Security.isSecuritySettingsFlowbranch as it is, so only the voluntary entry stays on the Enabled page (from Fix: keep 2FA RHP open on Enabled page after Got it from Security settings).Result:
goBack(), which callsquitAndNavigateBack('home')and lands on Home.openApp()and resumes onboarding at the saved step.What specific scenarios should we cover in automated tests?
Add
tests/unit/pages/settings/Security/TwoFactorAuth/DynamicSuccessPageTest.tsx. MockSuccessPageBaseto captureonButtonPress, mockuseDynamicBackPath, and mockNavigation. No test covers this page today.home,hasCompletedGuidedSetupFlow: true. ExpectgoBack('home'), and expect no call tonavigate(SETTINGS_2FA_ENABLED)orresumeOnboardingAfterRequired2FASetup.home,twoFactorAuthSetupInProgress: true,hasCompletedGuidedSetupFlow: false. ExpectrevealRouteBeforeDismissingModal(ROUTES.HOME)followed byresumeOnboardingAfterRequired2FASetup.settings/security, onboarding complete. Expectnavigate(ROUTES.SETTINGS_2FA_ENABLED, {forceReplace: true})andclearTwoFactorAuthData(true).What alternative solutions did you explore? (Optional)
Alternatives considered
isForcedTwoFactorAuthSetup). Rejected: it adds global state that must be cleared by hand. The base route already carries the signal.isForcedOnboardingHandoffalone. Rejected: USD bank account and Xero 2FA setups by users with incomplete onboarding would be pulled into the onboarding handoff.account.needsTwoFactorAuthSetupat Got it time. Rejected: theopenAppresponse after enabling 2FA overwrites it, so the check is racy.Risk review
OnboardingGuard.ts:125-130). So the Enable button still opens the wizard with a Home base.DynamicSuccessPagereads the base. That dependency is real:validateTwoFactorAuthdefersopenApp()until the handoff on Got it (Session/index.ts:1487-1514). Step 2 keeps that handoff running for the Home base.useDynamicBackPathreturnsROUTES.HOMEif the navigation state isn't ready (useDynamicBackPath.ts:33-35). The success page mounts only after navigation is ready, so the risk is low.Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/101848#issuecomment-5771800818)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
melvin-bot commentedon Sep 22, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Krishna2323 (
External)melvin-bot commentedon Sep 22, 2026
Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.
melvin-bot commentedon Sep 25, 2026
@Krishna2323 Whoops! This issue is 2 days overdue. Let's get this updated quick!
ashusatyarthi-wq commentedon Sep 26, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When an invited admin logs in to an account where a workspace requires 2FA (e.g. Xero connected), the "2FA is required" overlay blocks the screen. After clicking "Enable", validating the account, and completing the 2FA flow, clicking the "Got it" button leaves the user stuck on the Account / Security settings page instead of redirecting them to the Home tab / Workspace.
What is the root cause of that problem?
In
RequireTwoFactorAuthenticationOverlay.tsx:93-96, the overlay's "Enable" button explicitly hardcodesROUTES.SETTINGS_SECURITYas the base path:This creates dynamic 2FA setup routes with
backTo = ROUTES.SETTINGS_SECURITY.When 2FA setup completes and the user reaches
DynamicSuccessPage.tsx:useDynamicBackPathresolves tosettings/security, makingfocusedRoute?.name === SCREENS.SETTINGS.SECURITY(isSecuritySettingsFlow = true).hasCompletedGuidedSetupFlowistrue, soisForcedOnboardingHandoffevaluates tofalse.DynamicSuccessPage.tsx:108-115:The app assumes the user entered voluntarily from Settings > Security to view their security settings, and keeps the modal open on
SETTINGS_2FA_ENABLEDover Account > Security. Because the overlay forced the entry usingROUTES.SETTINGS_SECURITY, the app cannot differentiate a forced 2FA entry from an intentional voluntary visit to Security Settings.What changes do you think we should make in order to solve the problem?
1. Pass
ROUTES.HOMEas the base route inRequireTwoFactorAuthenticationOverlay.tsxThe required 2FA overlay intercepts the user on Home / Workspace, not inside Security Settings. The base return destination for the forced flow should be
ROUTES.HOME:const handleOnPress = () => { snapshotOnboardingResumePathIfNeeded(); - Navigation.navigate(getTwoFactorAuthRoute(ROUTES.SETTINGS_SECURITY, {forceSetup: true})); + Navigation.navigate(getTwoFactorAuthRoute(ROUTES.HOME, {forceSetup: true})); };2. Ensure onboarding handoff in
DynamicSuccessPage.tsxhandles both base routesIn
DynamicSuccessPage.tsx:Update the check for forced onboarding handoff so that users who still need to complete onboarding resume onboarding whether the route originated from
HOMEorSETTINGS_SECURITY:When
onButtonPressruns:shouldReturnToOnboardingAfter2FAis true),completeForcedOnboarding2FAHandoff()dismisses to Home and resumes onboarding.isSecuritySettingsFlowis true), they stay on theSETTINGS_2FA_ENABLEDscreen in the RHP (preserving PR Fix: keep 2FA RHP open on Enabled page after Got it from Security settings #92637).dynamicBackPath === ROUTES.HOME),goBack()executesquitAndNavigateBack(dynamicBackPath), cleanly dismissing the modal and landing the user on the Home tab.What specific scenarios should be covered in tests?
Add unit tests in
tests/unit/TwoFactorAuthFlowTest.ts:RequireTwoFactorAuthenticationOverlay.Navigation.navigate/quitAndNavigateBackredirects toROUTES.HOME, NOTSETTINGS_2FA_ENABLED.SETTINGS_2FA_ENABLED.completeForcedOnboarding2FAHandofffires and resumes onboarding.What alternative solutions did you explore? (Optional)
isForcedTwoFactorAuthSetup):ROUTES.HOMEis stateless, self-cleaning, and uses the existingdynamicBackPathrouting architecture.Krishna2323 commentedon Sep 27, 2026
@MelvinBot, your root cause looks right to me, but I'd rather not add a new Onyx flag. The base route can already tell the forced entry apart. Please look into this approach instead:
RequireTwoFactorAuthenticationOverlay.tsx, passROUTES.HOMEas the base route instead ofROUTES.SETTINGS_SECURITY.DynamicSuccessPage.tsx, addisRequired2FAOverlayFlow = focusedRoute?.name === SCREENS.HOMEand gate the handoff on(isSecuritySettingsFlow || isRequired2FAOverlayFlow) && isForcedOnboardingHandoff.Onboarded admins should then fall through to
goBack()and land on Home, while the voluntary Settings > Security flow keeps its stay-in-RHP behavior from #92637. Please don't drop the base-route check entirely, since that would pull the USD bank account and Xero 2FA flows into the onboarding handoff for users who haven't finished onboarding.Please also confirm:
ROUTES.SETTINGS_SECURITYonly to get a stable non-onboarding base, or does something depend on the Security base specifically? UsingROUTES.HOMEmust not bring back [Due for payment 2026-10-07] [$250] Required 2FA setup screen is unresponsive, blocking new-domain login and account merge #91985 for users with incomplete onboarding.DynamicSuccessPageread the Security base for this flow?If this holds up, please update the proposal and cover these cases in tests:
35 remaining items
melvin-bot commentedon Nov 9, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Nov 9, 2026
Payment Summary
Resolving PRs:
Send users Home after required 2FA setup instead of Settings > Security #102482
Reviewer: @Krishna2323 owed $175 via NewDot
BugZero Checklist (@mallenexpensify)
melvin-bot commentedon Nov 12, 2026
@mallenexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
mallenexpensify commentedon Nov 13, 2026
Claude posting on behalf of Matt:
Waiting on C+ checklist from @Krishna2323.
Job price: $175 (standard, no Help Wanted, assigned 2026-09-22). Krishna2323 (C+): 100% once the checklist is in, via NewDot.
No deploy blockers or regressions on the issue or the PR.
Evidence
PAYPREP v1mallenexpensify commentedon Nov 13, 2026
@Krishna2323 plz complete the Contributor+ checklist and tag me in a post once you have. Thx
mallenexpensify commentedon Nov 13, 2026
Krishna2323 commentedon Nov 13, 2026
Contributor+ Checklist:
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to the comment on the PR: Required 2FA setup screen is unresponsive, blocking new-domain login and account merge #94486 (comment)
Link to the comment on the Issue: [Due for payment 2026-10-07] [$250] Required 2FA setup screen is unresponsive, blocking new-domain login and account merge #91985 (comment)
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Regression Test Proposal
Precondition:
Test:
Memberspage and invite Account B as an Admin.Two-factor authentication requiredscreen, clickEnable.Two-factor authentication enabledpage, clickGot it.Do we agree 👍 or 👎
Krishna2323 commentedon Nov 13, 2026
@mallenexpensify checklist completed ^
mallenexpensify commentedon Nov 15, 2026
Payment Summary
Contributor+: @Krishna2323 due $175 via NewDot