fix: fix login API error message

the login API does not return an error message

Change-Id: I76be8ca033effe8da98b6e0f5281561b183b6266
This commit is contained in:
yangshaoxue 2023-11-02 16:01:26 +08:00
parent a27c6daea6
commit 1cedd57d6a

View File

@ -54,7 +54,6 @@ async def _get_projects_and_unscope_token(
token: Optional[str] = None, token: Optional[str] = None,
project_enabled: bool = False, project_enabled: bool = False,
) -> Tuple[List[Any], str]: ) -> Tuple[List[Any], str]:
try:
auth_url = await utils.get_endpoint( auth_url = await utils.get_endpoint(
region=region, region=region,
service="keystone", service="keystone",
@ -87,11 +86,6 @@ async def _get_projects_and_unscope_token(
project_scope = unscope_client.auth.projects() project_scope = unscope_client.auth.projects()
unscope_token = token if token else session.get_token() unscope_token = token if token else session.get_token()
except Exception as e:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail=str(e),
)
if project_enabled: if project_enabled:
project_scope = [scope for scope in project_scope if scope.enabled] project_scope = [scope for scope in project_scope if scope.enabled]