Skip to content

Login flow skips magic code prompt for 2FA-enabled accounts #65388

Closed

Description

@m-natarajan

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.1.74-9
Reproducible in staging?: Y
Reproducible in production?: N
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @cead22
Slack conversation (hyperlinked to channel name): #Expensify Bugs

Action Performed:

  1. Enter your email on the login page (for an account with 2FA enabled)
  2. Observe that you're prompted for the authenticator password immediately, not the magic code
  3. Enter the authenticator password — it fails
  4. Click “Go back,” then click “Next” again (email is still filled in)
  5. This time, you’re prompted for the magic code, then the authenticator password
  6. Login is successful after completing both steps.

Expected Result:

Users should be prompted first for the magic code, then for the authenticator password in a consistent, sequential flow.

Actual Result:

The flow incorrectly prompts for the authenticator password first, resulting in failed login and requiring the user to restart the process manually.

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platforms:

Select the officially supported platforms where the issue was reproduced:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop
Platforms Tested: On which of our officially supported platforms was this issue tested:
  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
Recording.1371.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021940739167765805147
  • Upwork Job ID: 1940739167765805147
  • Last Price Increase: 2025-07-03
Issue OwnerCurrent Issue Owner: @brunovjk

Activity

  1. added
    DeployBlockerCash
    Daily
    Bug
    on Jul 3, 2025
  2. melvin-bot commented on Jul 3, 2025

    @melvin-bot

    Triggered auto assignment to @jliexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  3. github-actions commented on Jul 3, 2025

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  4. melvin-bot commented on Jul 3, 2025

    @melvin-bot

    Triggered auto assignment to @inimaga (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  5. melvin-bot commented on Jul 3, 2025

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  6. BlameGPT commented on Jul 3, 2025

    @BlameGPT
    Contributor

    Possible culprit PRs for this issue

    • [CP-stag] Revert "Bring back new sign-in page" #65374: This PR rewrites SignInPage, ChooseSSOOrMagicCode, ValidateCodeForm and other auth flow files while reverting the new sign-in logic, so the navigation order between magic-code and 2FA screens could be broken and now shows the authenticator prompt first.
    • Bring back new sign-in page #64786: It originally overhauled the entire sign-in and 2FA flow, and even after being reverted residual changes may remain, making it the next most likely source of the incorrect step sequence.
  7. 2 remaining items

  8. inimaga commented on Jul 3, 2025

    @inimaga
    Contributor

    After some investigation, I have found the reproducible steps:

    1. Go to https://new.expensify.com,
    2. Login with an account with 2FA enabled,
    3. Logout,
    4. Attempt to login with the same account,
    5. You'll be immediately prompted for the authenticator password, instead the magic code. (And when you enter either password or magic code at this stage, it'll fail),
    6. You have to go back to be able to login normally once again.

    I'm going to remove the deploy blocker label as reproducible in PROD.

  9. added
    Daily
    External
    and removed
    DeployBlockerCash
    on Jul 3, 2025
  10. changed the title [-]Login flow skips magic code prompt for 2FA-enabled accounts[/-] [+][$250] Login flow skips magic code prompt for 2FA-enabled accounts[/+] on Jul 3, 2025
  11. melvin-bot commented on Jul 3, 2025

    @melvin-bot
  12. added
    Help Wanted
    on Jul 3, 2025
  13. melvin-bot commented on Jul 3, 2025

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @brunovjk (External)

  14. war-in commented on Jul 3, 2025

    @war-in
    Contributor

    Hi 👋 as the issue still can be reproduced on staging (based on this comment), I'd say that it's not related to those PRs as they have been reverted and cherry-picked to staging yesterday.

    Also, isn't this issue duplicated?

  15. inimaga commented on Jul 3, 2025

    @inimaga
    Contributor

    @war-in you're right. It is a duplicate. I have updated the replication steps here. But going to close this in favour of that, as it was created much earlier.

  16. changed the title [-][$250] Login flow skips magic code prompt for 2FA-enabled accounts[/-] [+]Login flow skips magic code prompt for 2FA-enabled accounts[/+] on Jul 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugDailyEngineeringExternalHelp Wanted

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions