feat(auth): add need help link to 2FA page#60404
Merged
Merged
Conversation
Users who have lost their authenticator device, passkey, and backup codes had no path to reach support from /login/2fa. The other auth pages (Login, PasswordReset, InviteSignup) already expose a support affordance — this brings the 2FA page in line by adding a "Need help?" link next to the description, before submission. Cloud-only, matching the existing pattern in Login.tsx's error banner. Generated-By: PostHog Code Task-Id: 5be83fac-bccb-47c0-904b-64ee54866848
Contributor
|
Reviews (1): Last reviewed commit: "feat(auth): add need help link to 2FA pa..." | Re-trigger Greptile |
Contributor
|
Size Change: 0 B Total Size: 80.3 MB ℹ️ View Unchanged
|
Contributor
|
🎭 Playwright report · View test results →
These issues are not necessarily caused by your changes. |
yasen-posthog
approved these changes
May 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Throughout the login flow, PostHog already exposes a "Need help?" / contact-support affordance to unauthenticated users — on
Login,PasswordReset, andInviteSignup. The 2FA page (/login/2fa) had no such link.This is the one place a user can be permanently locked out: they've passed primary auth but lost their authenticator device, passkey, and backup codes. Without a visible support path before submission, those users have no way forward.
Changes
Added a "Need help?" link next to the description text on the 2FA page:
Clicking it opens the support modal in support mode (
kind: 'support',target_area: 'login') — matching the inline "Need help?" link already used insideLogin.tsx's error banner. Gated onpreflight?.cloud, same as the other support affordances across the auth flow (PostHog only offers support to cloud customers).Single file changed:
frontend/src/scenes/authentication/Login2FA.tsx. No logic changes, no new component, no new generated types.How did you test this code?
I'm an agent (PostHog Code). I did not perform manual testing in a browser. What I did run:
pnpm --filter=@posthog/frontend formaton the edited file — passed (oxlint + oxfmt clean).pnpm --filter=@posthog/frontend typescript:check— crashed locally with a Node OOM (V8 abort, unrelated to this change); leaving CI to verify typecheck.Manual verification steps for the reviewer (requires cloud preflight — locally
CLOUD_DEPLOYMENT=DEV ./bin/start):/login/2fawhile in the 2FA step of login.target_area: 'login'.Publish to changelog?
no
🤖 Agent context
<SupportModalButton />toBridgePage'sfooterslot, matchingLogin.tsx/PasswordReset.tsx/InviteSignup.tsx. Rejected after user feedback — they wanted the link inline near the description, not in the footer, so locked-out users notice it the moment they realize none of the listed 2FA methods work for them.<Link>+openSupportForm({ kind: 'support', target_area: 'login' }), copied directly from the existing pattern inLogin.tsx's error banner — same data-attr convention, same support kind, same target area.frontend/src/lib/components/Support/SupportModal.tsx:67-80, wheredestroy()callsroot.unmount()synchronously insideLemonModal'sonAfterClose. Pre-existing on every entry point toopenSupportForm, not introduced here — left out of scope.Created with PostHog Code