Point 2FA page breadcrumbs to Password and authentication

What does this MR do and why?

The two-factor authentication settings were split into a standalone page at /-/profile/two_factor_auth (previously 2FA lived on the account page). The recovery-codes, OTP-setup, and add-passkey pages still set their page title and breadcrumb to Account, so completing one of those flows navigated the user back to the account page instead of the authentication page they came from.

This points their titles and breadcrumbs to the Password and authentication page (profile_two_factor_auth_path), matching user_settings/passwords/edit, which already breadcrumbs there.

Audited alongside this change and confirmed correct as-is (no change needed):

  • Profiles::AccountsController#unlink already redirects to profile_two_factor_auth_path; the unlink button (_providers partial) renders only on the 2FA page, so that redirect is correct.
  • generate_support_pin correctly returns to the account page.
  • The EE overrides for the accounts/2FA controllers add no cross-redirects.

How to set up and validate locally

  1. Sign in and open Password and authentication (/-/profile/two_factor_auth).
  2. Set up an OTP authenticator (or regenerate recovery codes). On the recovery-codes screen, the breadcrumb reads Password and authentication and links back to the 2FA page (not Account).
  3. Visit Add passkey (/-/profile/passkeys/new); its breadcrumb links back to Password and authentication.

Testing

Feature specs updated to assert the breadcrumb links back to profile_two_factor_auth_path on the OTP-setup, recovery-codes, and add-passkey flows. All three :js examples pass locally.

Screenshots or screen recordings

Add-passkey page breadcrumb (/-/profile/passkeys/new). Before it linked back to Account; after it links to Password and authentication (profile_two_factor_auth_path). The recovery-codes and OTP-setup pages change the same way.

Light mode

Before After
before, light after, light

Dark mode

Before After
before, dark after, dark
Edited by Eduardo Sanz García

Merge request reports

Loading
Loading