Skip to content

fix(login): always render sign-in form (fail-open on slow auth-methods) - #367

Merged
izzywdev merged 1 commit into
masterfrom
fix/login-fail-open-form
Jul 23, 2026
Merged

fix(login): always render sign-in form (fail-open on slow auth-methods)#367
izzywdev merged 1 commit into
masterfrom
fix/login-fail-open-form

Conversation

@izzywdev

Copy link
Copy Markdown
Owner

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 the catch that sets FALLBACK_METHODS never fired. Result: 30s of blank, unusable login.

Fix

Initialize authMethods to the existing password-only FALLBACK_METHODS so 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 of useState(null), and drop the authMethods && gate on the form.

Out of scope

🤖 Generated with Claude Code

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
@izzywdev izzywdev added the auto-merge Enable squash auto-merge once CI passes label Jul 23, 2026
@github-actions
github-actions Bot enabled auto-merge (squash) July 23, 2026 16:56
@izzywdev
izzywdev merged commit fca82b8 into master Jul 23, 2026
50 checks passed
@izzywdev
izzywdev deleted the fix/login-fail-open-form branch July 23, 2026 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge Enable squash auto-merge once CI passes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant