Update backend/server/routers/auth_router_oidc.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Wenjie Zhang 2026-04-02 12:12:56 +08:00 committed by GitHub
parent a121592fac
commit ca016151e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -349,14 +349,14 @@ async def oidc_login_url_handler(redirect_path: str = "/"):
if not oidc_config.enabled or not oidc_config.is_configured(): if not oidc_config.enabled or not oidc_config.is_configured():
raise HTTPException( raise HTTPException(
status_code=status.HTTP_503_SERVICE_UNAVAILABLE, status_code=status.HTTP_503_SERVICE_UNAVAILABLE,
detail="OIDC is not enabled or not configured" detail="OIDC 登录暂不可用,请联系管理员"
) )
login_url = await OIDCUtils.build_authorization_url(redirect_path) login_url = await OIDCUtils.build_authorization_url(redirect_path)
if not login_url: if not login_url:
raise HTTPException( raise HTTPException(
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
detail="Failed to build authorization URL" detail="生成登录链接失败,请稍后重试或联系管理员"
) )
return {"login_url": login_url} return {"login_url": login_url}