fix(login): always render sign-in form (fail-open on slow auth-methods) - #367
Merged
Conversation
The login page gated the entire credentials form on getAuthMethods() resolving (authMethods !== null). When that request HUNG on its 30s axios timeout — a hang, not a rejection, so the catch never fired — the page rendered only the header and footer with no form, so login was blank and inaccessible in prod. Initialize authMethods to the password-only FALLBACK_METHODS so the email/password form renders immediately; getAuthMethods now only upgrades the UI (Google/MFA) as progressive enhancement when it resolves. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session-Id: f636c22e-1cd7-401e-8843-97e3e3a4ba01
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
Prod login rendered a blank form (no email/password/Sign-in) — only the "Welcome to FuzeFront" header + "Create an account" footer. Diagnosed live: the page calls
getAuthMethods()(GET /api/v1/security/methods) on mount and gates the entire credentials form on it (authMethods !== null, LoginPage.tsx). That endpoint is intermittently slow and sometimes hangs to its 30s axios timeout — a hang, not a rejection, so thecatchthat setsFALLBACK_METHODSnever fired. Result: 30s of blank, unusable login.Fix
Initialize
authMethodsto the existing password-onlyFALLBACK_METHODSso the email/password form always renders immediately.getAuthMethods()becomes progressive enhancement — it upgrades the UI (Google/MFA/signup checks) when it resolves, and a slow/failed fetch can no longer hide the form.2-line behavioral change (+ comment):
useState(FALLBACK_METHODS)instead ofuseState(null), and drop theauthMethods &&gate on the form.Out of scope
/api/v1/security/methodsintermittent latency → fix(security): internal authorize hop + structured logging #366 (same Authentik-hairpin class).app-registry listApps10s timeout (post-login launcher) — separate pre-existing gap.🤖 Generated with Claude Code