fix(dashboard-auth): prevent 500 crash on GET /auth/login?provider=basic (#58166) - #58315
Closed
nankingjing wants to merge 1 commit into
Closed
nankingjing wants to merge 1 commit into
nankingjing wants to merge 1 commit into
Conversation
…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>
Contributor
Duplicate of #56666 (earlier open route-level fix for the same crash). Both add a |
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. |
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.
Closes #58166
Summary
GET /auth/login?provider=basicreturns HTTP 500 because BasicAuthProvider.start_login() always raises NotImplementedError. The handler only catches ProviderError, so the raw NotImplementedError becomes a 500.Root Cause
BasicAuthProvideris password-only — it has no OAuth redirect flow. It correctly raises NotImplementedError when start_login() is called. Butauth_login()indashboard_auth/routes.pycalledp.start_login()unconditionally for every provider that passed thesupports_sessioncheck.Fix
+6/-0: add a
supports_passwordguard before thestart_login()call. Password-only providers redirect directly to/logininstead of attempting the OAuth flow.The
POST /auth/password-loginendpoint already handles username+password authentication correctly.Files
hermes_cli/dashboard_auth/routes.py—auth_login()handler