fix(security): remediate telecom compliance findings
This commit is contained in:
@@ -49,12 +49,12 @@ async def exchange_casdoor_code(code: str) -> dict | None:
|
||||
"code": code,
|
||||
}, timeout=10)
|
||||
if resp.status_code != 200:
|
||||
logger.error(f"[Casdoor] token exchange failed: status={resp.status_code}, body={resp.text[:500]}")
|
||||
logger.error("[Casdoor] token exchange failed: status=%s", resp.status_code)
|
||||
return None
|
||||
token_data = resp.json()
|
||||
access_token = token_data.get("access_token", "")
|
||||
if not access_token:
|
||||
logger.error(f"[Casdoor] no access_token in response: {token_data}")
|
||||
logger.error("[Casdoor] token exchange response did not contain an access token")
|
||||
return None
|
||||
except Exception as e:
|
||||
logger.error(f"[Casdoor] token exchange exception: {e}")
|
||||
@@ -67,7 +67,7 @@ async def exchange_casdoor_code(code: str) -> dict | None:
|
||||
"Authorization": f"Bearer {access_token}"
|
||||
}, timeout=10)
|
||||
if resp.status_code != 200:
|
||||
logger.error(f"[Casdoor] userinfo failed: status={resp.status_code}, body={resp.text[:500]}")
|
||||
logger.error("[Casdoor] userinfo failed: status=%s", resp.status_code)
|
||||
return None
|
||||
return resp.json()
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user