fix: skip auto-SSO redirect for password-only auth providers - #163
Open
hashbender wants to merge 1 commit into
Open
fix: skip auto-SSO redirect for password-only auth providers#163hashbender wants to merge 1 commit into
hashbender wants to merge 1 commit into
Conversation
|
Review Complete Risk: 🟢 Low (5/100) — no findings · 8 LOC across 1 file Single-file PR adding dashboard authentication middleware with OAuth provider abstraction and session cookie management. No issues found. Files Reviewed (1 files) |
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.
What does this PR do?
_auto_sso_response()unconditionally redirects to/auth/loginwhen there is exactly one session provider. For password-only providers (e.g. BasicAuthProvider),/auth/logincallsstart_login()which raisesNotImplementedError→ 500 Internal Server Error.Fix: check
provider.supports_passwordbefore redirecting. If True, returnNoneto let the/logininterstitial render the credential form.Related Issue
Fixes NousResearch#56067
Type of Change
Changes Made
hermes_cli/dashboard_auth/middleware.py: Added guard in_auto_sso_response()to skip auto-redirect when the sole provider is password-only.How to Test
http://host:9119/in browser/loginwith credential form (not 500)Checklist
Mirror-of: NousResearch#56082
NousResearch#56082