fix: improve error handling and logging in OIDC token exchange and redirect callback
This commit is contained in:
+5
-1
@@ -115,7 +115,11 @@ async def auth_callback(payload: AuthCallbackRequest):
|
||||
if response.status_code != 200:
|
||||
raise HTTPException(status_code=400, detail=f"OIDC token exchange failed: {response.text}")
|
||||
|
||||
return response.json()
|
||||
result = response.json()
|
||||
logger.debug("OIDC token exchange result keys: %s", list(result.keys()))
|
||||
if "access_token" not in result:
|
||||
logger.warning("OIDC token response missing access_token; may return only id_token or an opaque token")
|
||||
return result
|
||||
|
||||
@app.post("/chat", response_class=StreamingResponse)
|
||||
async def chat(request: ChatRequest, token=Depends(validate_token)):
|
||||
|
||||
Reference in New Issue
Block a user