fix(auth): fix SSO auto-login check to use strict boolean comparison and add tests

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
Agent-Logs-Url: https://github.com/christianlouis/DocuElevate/sessions/51d9bb59-d4b5-4713-9a4a-8acfc599e2cc
This commit is contained in:
copilot-swe-agent[bot]
2026-03-22 12:41:57 +00:00
parent 54a0ba1023
commit 840a5bcd5b
2 changed files with 328 additions and 1 deletions
+1 -1
View File
@@ -435,7 +435,7 @@ async def login(request: Request):
show_oauth = OAUTH_CONFIGURED
# SSO Auto Login: redirect directly to SSO provider if configured
if show_oauth and settings.sso_auto_login and not error and not message:
if show_oauth and getattr(settings, "sso_auto_login", False) is True and not error and not message:
return RedirectResponse(url="/oauth-login", status_code=status.HTTP_302_FOUND)
return templates.TemplateResponse(