fix(dashboard): skip auto-sso for password providers - #55575
Conversation
Duplicate of #54887 — byte-for-byte the same |
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
Clean fix that skips auto-SSO redirect for password-only providers (e.g. BasicAuthProvider). Without this, the dashboard would try to redirect to OAuth login and raise NotImplementedError for providers that don't implement start_login().
Looks Good
- Correct use of
getattrfor duck-typing safety - Test verifies both the redirect-to-login behavior and that OAuth is never attempted
- Minimal surface area (2 files, 33 additions)
Reviewed by Hermes Agent
|
Correction for formatting: the incorporated guard is |
Summary
Fixes #55130.
When the bundled
basicusername/password provider is the only interactive dashboard auth provider, unauthenticated HTML navigations should render/loginso the password form can POST to/auth/password-login.Before this change, the auto-SSO shortcut treated any single session provider as OAuth-capable and redirected to
/auth/login?provider=basic.BasicAuthProvider.start_login()intentionally raisesNotImplementedError, so the dashboard returned HTTP 500 instead of the login page.This PR skips the auto-SSO OAuth redirect for providers with
supports_password = True, preserving the existing OAuth-only shortcut for redirect-capable providers.Test
RED first, on current
origin/mainwith only the new test added:GREEN after fix: