BloopAI/vibe-kanban · error · Error
Auth methods lookup failed (${res.status})
Error message
Auth methods lookup failed (${res.status}) What it means
getAuthMethods fetches the available sign-in methods from GET ${API_BASE}/v1/auth/methods (with cache:'no-store') so the login page can show local-password and/or OAuth options. If the response is not OK, it throws 'Auth methods lookup failed (<status>)'. This error means the client could not determine which authentication methods the server supports.
Source
Thrown at packages/remote-web/src/shared/lib/api.ts:75
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
provider,
return_to: returnTo,
app_challenge: appChallenge,
}),
});
if (!res.ok) {
throw new Error(`OAuth init failed (${res.status})`);
}
return res.json();
}
export async function getAuthMethods(): Promise<AuthMethodsResponse> {
const res = await fetch(`${API_BASE}/v1/auth/methods`, {
cache: "no-store",
});
if (!res.ok) {
throw new Error(`Auth methods lookup failed (${res.status})`);
}
return res.json();
}
export async function redeemOAuth(
handoffId: string,
appCode: string,
appVerifier: string,
): Promise<HandoffRedeemResponse> {
const res = await fetch(`${API_BASE}/v1/oauth/web/redeem`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
handoff_id: handoffId,
app_code: appCode,
app_verifier: appVerifier,
}),
});View on GitHub (pinned to 4deb7eca8f)
Solutions
- Read the HTTP status from the error message and correlate with server logs for /v1/auth/methods.
- Verify VITE_API_BASE_URL points at the correct remote API server.
- Confirm the deployed server version includes the /v1/auth/methods endpoint (upgrade if 404).
- Check server auth configuration load errors (500 usually means the backend failed to read its auth settings).
- Implement a UI fallback so the login page still renders (e.g. default to showing OAuth options) when lookup fails, and retry.
- Retry after transient 5xx/429 conditions clear.
Example fix
// before
const methods = await getAuthMethods();
// after: degrade gracefully
let methods: AuthMethodsResponse | null = null;
try {
methods = await getAuthMethods();
} catch {
methods = { local_auth_enabled: true, oauth_providers: ['github', 'google'] };
} Defensive patterns
Strategy: fallback
Validate before calling
// check API reachability before fetching auth methods
const ping = await fetch(`${API_BASE}/v1/auth/methods`, { method: 'HEAD' }).catch(() => null);
if (!ping || !ping.ok) {
console.warn('auth methods endpoint unreachable; using defaults');
} Type guard
function isAuthMethodsResponse(x: unknown): x is AuthMethodsResponse {
return typeof x === 'object' && x !== null
&& typeof (x as any).local_auth_enabled === 'boolean'
&& Array.isArray((x as any).oauth_providers);
} Try / catch
let methods: AuthMethodsResponse;
try {
methods = await getAuthMethods();
} catch (e) {
const status = (e as Error).message.match(/\((\d+)\)/)?.[1];
console.warn(`auth methods lookup failed (HTTP ${status ?? 'network'}), falling back`);
methods = { local_auth_enabled: true, oauth_providers: ['github', 'google'] };
} Prevention
- Set VITE_API_BASE_URL correctly for the deployment environment.
- Add a login-page fallback so auth method lookup failure does not block sign-in.
- Use cache:'no-store' (as the library does) and refetch on window focus to recover after transient failures.
- Confirm the deployed server version exposes /v1/auth/methods.
- Alert on 5xx rates for /v1/auth/methods.
When it happens
Trigger: Calling getAuthMethods() and the GET /v1/auth/methods request returns non-2xx: wrong API_BASE so route 404s, server error while reading auth configuration (500), server restarting or behind a failing proxy (502/503), or rate limiting (429). Network-level failures throw fetch TypeErrors instead — this error fires only when an HTTP response was received with a bad status.
Common situations: Login page loads while the remote API is down or deploying; VITE_API_BASE_URL unset or misconfigured in a self-hosted deployment; older server version without /v1/auth/methods route (404); corporate proxy returning 5xx for the API host.
Related errors
- Host returned HTTP ${response.status}
- OAuth init failed (${res.status})
- OAuth redeem failed (${res.status})
- Local login failed (${res.status})
- WebRTC offer failed: ${response.status} ${response.statusTex
AI-assisted analysis of BloopAI/vibe-kanban@4deb7eca8f (2026-08-29).
Data as JSON: /api/errors/52acfc17f69557f1.
Report an issue: GitHub.