Point identity-linking redirects at 2FA page
What does this MR do and why?
Connected accounts (connect/disconnect) and passkeys now live on the standalone Password and authentication page (profile_two_factor_auth_path), but several signed-in identity-linking flows still redirected users back to the Account page (profile_account_path) after an action, so "connect" did not land on the same page as "disconnect".
Point these redirects at the Password and authentication page:
OmniauthCallbacksController: identity link success (Authentication method updated), link failure, and the unverified SAML initiation notice.UserSettings::IdentitiesController: the authorize step — identity already exists, create success, and the missing-session guard.- The Cancel button on the identity authorize page.
Group SAML and SCIM onboarding are unaffected: group SAML uses Groups::OmniauthCallbacksController with its own redirects, SCIM is a separate provisioning path, and sign-in/sign-up take the sign_in_user_flow branch rather than the linking branch.
The redirect targets are fixed internal paths (not user-supplied), so there is no open-redirect surface.
References
Split from the same cleanup as !246381 (merged) (which points the 2FA page breadcrumbs and titles at Password and authentication). The two changes touch disjoint files and land independently.
Screenshots or screen recordings
Behavior-only change (redirect target). After linking/connecting an account, hitting the unverified-SAML guard, or cancelling the authorize step, the user now lands on the Password and authentication page instead of the Account page — matching where disconnect already returns them.
| Before | After |
|---|---|
How to set up and validate locally
- Configure an OmniAuth provider (for example a test SAML or OIDC app) and sign in.
- From the Password and authentication page, link/connect an identity, or open the authorize step and press Cancel.
- Confirm you land back on the Password and authentication page (
profile_two_factor_auth_path), not the Account page.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist.