File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
cads_processing_api_service Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -106,17 +106,18 @@ def authenticate_user(
106
106
SETTINGS .portal_header_name : portal_header ,
107
107
},
108
108
)
109
+ response_content : dict [str , Any ] = response .json ()
109
110
if response .status_code in (
110
111
fastapi .status .HTTP_401_UNAUTHORIZED ,
111
112
fastapi .status .HTTP_403_FORBIDDEN ,
112
113
):
113
114
raise exceptions .PermissionDenied (
114
115
status_code = response .status_code ,
115
- title = response . json () ["title" ],
116
- detail = " operation not allowed" ,
116
+ title = response_content ["title" ],
117
+ detail = response_content . get ( "detail" , " operation not allowed") ,
117
118
)
118
119
response .raise_for_status ()
119
- user : dict [str , str ] = response . json ()
120
+ user : dict [str , str ] = response_content
120
121
user_uid : str = user ["sub" ]
121
122
user_role : str | None = user .get ("role" , None )
122
123
email : str | None = user .get ("email" , None )
You can’t perform that action at this time.
0 commit comments