Skip to content

feat(settings): move finish account setup set password to React - #21248

Merged
vbudhram merged 1 commit into
mainfrom
fxa-14380
Sep 21, 2026
Merged

vbudhram merged 1 commit into
mainfrom
fxa-14380

Conversation

@vbudhram

@vbudhram vbudhram commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Because

  • SubPlat confirmed the post_verify/finish_account_setup/set_password page is not used any more.
  • The ticket first asked for a React port. That port is no longer worth the work, so the page goes away instead.

This pull request

  • Deletes the Backbone view set_password.js and its mustache template.
  • Deletes the view spec and its require line in test_start.js.
  • Removes the route from router.js.
  • Removes the path from FRONTEND_ROUTES in content-server-routes.js.
  • Reverts the React port from the earlier commits on this branch. fxa-settings and fxa-shared match main with no diff.

Issue that this pull request solves

Closes: FXA-14380

Checklist

Put an x in the boxes that apply

  • My commit is GPG signed.
  • If applicable, I have modified or added tests which pass locally.
  • I have added necessary documentation (if appropriate).
  • I have verified that my changes render correctly in RTL (if appropriate).
  • I have manually reviewed all AI generated code.

How to review (Optional)

  • Key files/areas to focus on: the two route removals in router.js and content-server-routes.js.
  • Suggested review order: the two route files first, then the deleted view, template, and spec.
  • Risky or complex parts: fxa-auth-server still builds this URL for subscription reminder emails, so the links in those emails now go nowhere. See the follow-up note below.

Screenshots (Optional)

None. This pull request only deletes a page.

Other information (Optional)

Follow-up for the subscription platform team, not in this pull request: retire the smtp config entry in fxa-auth-server config/index.ts and the subscriptionAccountReminderFirst and subscriptionAccountReminderSecond templates that link to this page.

Dead code left in place, all in fxa-content-server, now orphaned: app/scripts/models/verification/set-password.js, the finishSetup chain in models/user.js, models/account.js, and lib/fxa-client.js, and Vat.register('jwt') in lib/vat.js.

Local checks: eslint on fxa-content-server exits 0. npx nx lint fxa-settings exits 0. fxa-content-server has no local unit test script, so CI runs that suite. No functional test names this page. The stack was not started.

Copilot AI balanced review requested due to automatic review settings September 17, 2026 20:06
@vbudhram
vbudhram requested review from a team as code owners September 17, 2026 20:06
@vbudhram vbudhram added the auto label Sep 17, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The route can be unavailable with its feature flag disabled, and required functional coverage and lastLogin persistence remain unresolved.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Migrates the subscription finish-account-setup password flow from Backbone to React while preserving the existing email-link URL.

Changes:

  • Adds React routing, query validation, account setup, redirects, and subscription-specific UI.
  • Updates shared password components, localization, stories, and telemetry documentation.
  • Removes the obsolete Backbone route, view, template, and tests.
File summaries
File Summary Review findings
packages/fxa-shared/metrics/glean/fxa-ui-metrics.yaml Documents the subscription telemetry reason.
packages/fxa-settings/src/pages/PostVerify/SetPassword/mocks.tsx Adds subscription flow mocks.
packages/fxa-settings/src/pages/PostVerify/SetPassword/interfaces.ts Adds subscription page properties and form support.
packages/fxa-settings/src/pages/PostVerify/SetPassword/index.tsx Renders subscription-specific password setup UI.
packages/fxa-settings/src/pages/PostVerify/SetPassword/index.test.tsx Tests subscription password setup behavior.
packages/fxa-settings/src/pages/PostVerify/SetPassword/index.stories.tsx Adds subscription Storybook states.
packages/fxa-settings/src/pages/PostVerify/SetPassword/finish-account-setup-container.tsx Validates link parameters, completes setup, stores the account, and redirects. Moderate (1 vote): Persist lastLogin when storing the account.
Moderate (1 vote): Add functional coverage for a generated subscription finish-setup link.
packages/fxa-settings/src/pages/PostVerify/SetPassword/finish-account-setup-container.test.tsx Tests the finish-account-setup container.
packages/fxa-settings/src/pages/PostVerify/SetPassword/en.ftl Adds subscription password setup strings.
packages/fxa-settings/src/models/pages/post-verify/index.ts Exports post-verify page models.
packages/fxa-settings/src/models/pages/post-verify/finish-account-setup-query-params.ts Validates email-link query parameters.
packages/fxa-settings/src/models/pages/post-verify/finish-account-setup-query-params.test.ts Tests query parameter validation.
packages/fxa-settings/src/components/PasswordStrengthInline/index.tsx Supports subscription password criteria.
packages/fxa-settings/src/components/LinkDamaged/index.tsx Handles damaged finish-setup links.
packages/fxa-settings/src/components/LinkDamaged/en.ftl Adds damaged-link localization.
packages/fxa-settings/src/components/FormSetupAccount/interfaces.ts Expands password form type support.
packages/fxa-settings/src/components/FormPasswordWithInlineCriteria/index.tsx Adds subscription form behavior and labels.
packages/fxa-settings/src/components/FormPasswordWithInlineCriteria/en.ftl Adds subscription form localization.
packages/fxa-settings/src/components/App/index.tsx Registers the React route. Moderate (1 vote): Add functional coverage for the live finish-account-setup link and response flow.
packages/fxa-content-server/server/lib/routes/react-app/index.js Registers the content-server React route. Critical (3 votes): The URL has no handler when postVerifyThirdPartyAuthRoutes is disabled; use an unconditional route group or retain a fallback.
Moderate (1 vote): Add functional or Playwright coverage for a generated subscription finish-setup link.
packages/fxa-content-server/app/tests/test_start.js Removes registration of the deleted Backbone test.
packages/fxa-content-server/app/tests/spec/views/post_verify/finish_account_setup/set_password.js Deletes obsolete Backbone view tests.
packages/fxa-content-server/app/scripts/views/post_verify/finish_account_setup/set_password.js Deletes the Backbone view.
packages/fxa-content-server/app/scripts/templates/post_verify/finish_account_setup/set_password.mustache Deletes the Backbone template.
packages/fxa-content-server/app/scripts/lib/router.js Removes the Backbone route entry.
Review details

Suppressed comments (4)

packages/fxa-content-server/server/lib/routes/react-app/index.js:159

  • The unit tests mock the query-param hook, the page, and AuthClient.finishSetup, so they do not exercise the live /post_verify/finish_account_setup/set_password URL through content-server routing or verify a real subscription finish-setup link can submit successfully. Since this is a live email entry point and the Backbone fallback is deleted, add a Playwright/functional test using a stub subscription account and its generated email link (the repository already has a parallel, auto-cleaned TestAccountTracker fixture).
        // The subscription "finish account setup" email link. The URL is
        // fixed by links already sitting in inboxes.
        'post_verify/finish_account_setup/set_password',

packages/fxa-settings/src/components/App/index.tsx:698

  • Please add a functional test for a real post_verify/finish_account_setup/set_password link before merging (or track it as a required follow-up). The new tests mount the container directly, so they do not verify that the content-server route reaches this lazy route or that a real /account/finish_setup response completes the one-use email flow; the existing Playwright suite has post-verify coverage but no test for this path.
        {/* The subscription "finish account setup" email link. */}
        <Route
          path="/post_verify/finish_account_setup/set_password/*"
          element={<FinishAccountSetupContainer {...{ integration }} />}
        />

packages/fxa-settings/src/pages/PostVerify/SetPassword/finish-account-setup-container.tsx:48

  • Please persist lastLogin when storing this newly signed-in account. lastStoredAccount() only considers accounts with a lastLogin timestamp (src/lib/cache.ts:90-101), and the index/sign-in flows use it when currentAccountUid is unavailable, so this account cannot be recovered after that storage-eviction path; the other React auth flows set lastLogin: Date.now().
        storeAccountData({

packages/fxa-settings/src/pages/PostVerify/SetPassword/finish-account-setup-container.tsx:42

  • The new tests mock the query model, SetPassword, and authClient.finishSetup, so they cannot exercise the actual email URL through the content-server route group and /account/finish_setup. This replaces the only live handler for smtp.accountFinishSetupUrl while deleting the Backbone implementation; add a functional test that follows a generated subscription finish-setup link and completes the flow before removing the fallback.
        const { uid, sessionToken, verified } = await authClient.finishSetup(
  • Files reviewed: 25/25 changed files
  • Comments generated: 1
  • Review effort level: Lite (auto)

Note

Copilot is running an experiment and ran this review at Lite.


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

// Both set-password routes plus service-welcome ride the
// The subscription "finish account setup" email link. The URL is
// fixed by links already sitting in inboxes.
'post_verify/finish_account_setup/set_password',

set-password-subscription-heading = Create a { -product-mozilla-account }
# $productName (String) - the name of the subscribed product, e.g. Mozilla VPN
set-password-subscription-heading-with-product = Create a { -product-mozilla-account } <span>Continue to { $productName }</span>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be one string and/or can we split this to two strings?

@vbudhram

Copy link
Copy Markdown
Contributor Author

Confirmed with subplat, these pages are not used anymore. Do not port them to React and remove from content-server.

…sword page

## Because

- SubPlat confirmed the `post_verify/finish_account_setup/set_password` page is not used any more.
- The ticket first asked for a React port. That port is no longer worth the work, so the page goes away instead.

## This pull request

- Deletes the Backbone view `set_password.js` and its mustache template.
- Deletes the view spec and its `require` line in `test_start.js`.
- Removes the route from `router.js`.
- Removes the path from `FRONTEND_ROUTES` in `content-server-routes.js`.
- Reverts the React port from the earlier commits on this branch. `fxa-settings` and `fxa-shared` match `main` with no diff.

## Issue that this pull request solves

Closes: FXA-14380

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The removed route is still linked from active subscription reminder emails, causing those links to return 404.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 2 High severity

Open (2)

'post_verify/cad_qr/scan_code',
'post_verify/cad_qr/connected',
'post_verify/finish_account_setup/set_password',
'post_verify/newsletters/add_newsletters',

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to file a follow up ticket to remove those as well. Lets just keep this PR focused for now.

@LZoog LZoog Sep 21, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vbudhram should we add a redirect for these though? If someone clicks on an old email that links-out here, can we just take them to our create_password page which will redirect to signin if they set a password?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LZoog Probably not worth it since these emails have not gone out in over a year

@LZoog LZoog left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@vbudhram
vbudhram merged commit 19de34f into main Sep 21, 2026
21 of 22 checks passed
@vbudhram
vbudhram deleted the fxa-14380 branch September 21, 2026 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants