Skip to content

fix(dashboard-auth): prevent 500 crash on GET /auth/login?provider=basic (#58166) - #58315

Closed
nankingjing wants to merge 1 commit into
NousResearch:mainfrom
nankingjing:fix/58166-basic-auth-login-500
Closed

nankingjing wants to merge 1 commit into
NousResearch:mainfrom
nankingjing:fix/58166-basic-auth-login-500

Conversation

@nankingjing

Copy link
Copy Markdown
Contributor

Closes #58166

Summary

GET /auth/login?provider=basic returns HTTP 500 because BasicAuthProvider.start_login() always raises NotImplementedError. The handler only catches ProviderError, so the raw NotImplementedError becomes a 500.

Root Cause

BasicAuthProvider is password-only — it has no OAuth redirect flow. It correctly raises NotImplementedError when start_login() is called. But auth_login() in dashboard_auth/routes.py called p.start_login() unconditionally for every provider that passed the supports_session check.

Fix

+6/-0: add a supports_password guard before the start_login() call. Password-only providers redirect directly to /login instead of attempting the OAuth flow.

The POST /auth/password-login endpoint already handles username+password authentication correctly.

Files

hermes_cli/dashboard_auth/routes.pyauth_login() handler

…sic (NousResearch#58166)

BasicAuthProvider.start_login() always raises NotImplementedError
because the provider is password-only. The auth_login() handler only
catches ProviderError, so the raw NotImplementedError was converted
to an HTTP 500 by FastAPI.

Add a supports_password guard before the start_login() call:
password-only providers now redirect directly to /login instead of
attempting the OAuth redirect flow, which does not exist for them.

Fixes NousResearch#58166

Co-Authored-By: Claude <noreply@anthropic.com>
@alt-glitch alt-glitch added type/bug Something isn't working comp/dashboard Web dashboard / control panel UI (dashboard/, landing) area/auth Authentication, OAuth, credential pools P2 Medium — degraded but workaround exists duplicate This issue or pull request already exists labels Jul 4, 2026
@alt-glitch

Copy link
Copy Markdown
Contributor

This was generated by AI during triage.

Duplicate of #56666 (earlier open route-level fix for the same crash). Both add a supports_password guard in auth_login() before calling start_login() on the password-only BasicAuthProvider — same file, same function, same mechanism; the only difference is this PR redirects to /login (302) while #56666 returns 400. This is distinct from the middleware-side auto-SSO prevention fix #54887 (which stays related). Underlying dashboard-500 anchor: #55130.

@nankingjing

Copy link
Copy Markdown
Contributor Author

Closing per @alt-glitch triage — duplicate of an earlier open PR. Keeping the fix on our fork for reference. Thanks for the review.

@nankingjing nankingjing closed this Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/auth Authentication, OAuth, credential pools comp/dashboard Web dashboard / control panel UI (dashboard/, landing) duplicate This issue or pull request already exists P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(dashboard-auth): GET /auth/login?provider=basic returns HTTP 500 (NotImplementedError in BasicAuthProvider.start_login)

2 participants